mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Currently we're only able to put up one frame and we can have only one layer, but this is enough to draw a green circle in a sample app. A future CL will wire this up to Sky and add support for drawing a second frame. R=eseidel@chromium.org, ojan@chromium.org Review URL: https://codereview.chromium.org/740923002
47 lines
999 B
C++
47 lines
999 B
C++
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef SKY_COMPOSITOR_LAYER_H_
|
|
#define SKY_COMPOSITOR_LAYER_H_
|
|
|
|
#include "base/memory/ref_counted.h"
|
|
#include "mojo/gpu/gl_texture.h"
|
|
#include "sky/compositor/layer_client.h"
|
|
#include "ui/gfx/geometry/rect.h"
|
|
|
|
namespace sky {
|
|
class LayerHost;
|
|
|
|
class Layer : public base::RefCounted<Layer> {
|
|
public:
|
|
explicit Layer(LayerClient* client);
|
|
|
|
void ClearClient();
|
|
|
|
void SetSize(const gfx::Size& size);
|
|
void Display();
|
|
|
|
scoped_ptr<mojo::GLTexture> GetTexture();
|
|
|
|
const gfx::Size& size() const { return size_; }
|
|
|
|
void set_host(LayerHost* host) { host_ = host; }
|
|
|
|
private:
|
|
friend class base::RefCounted<Layer>;
|
|
~Layer();
|
|
|
|
LayerClient* client_;
|
|
LayerHost* host_;
|
|
gfx::Size size_;
|
|
|
|
scoped_ptr<mojo::GLTexture> texture_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(Layer);
|
|
};
|
|
|
|
} // namespace sky
|
|
|
|
#endif // SKY_COMPOSITOR_LAYER_H_
|