Chromium Code Reviews| Index: sky/compositor/layer.h |
| diff --git a/sky/compositor/layer.h b/sky/compositor/layer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..94925278652b7e33146d2c5dae537b8f741d9438 |
| --- /dev/null |
| +++ b/sky/compositor/layer.h |
| @@ -0,0 +1,46 @@ |
| +// 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; } |
|
eseidel
2014/11/20 20:40:32
Huh? inlined methods are crazy_style?
abarth-chromium
2014/11/20 20:47:57
Trivial getters and setters are crazy_style.
|
| + |
| + private: |
| + friend class base::RefCounted<Layer>; |
|
eseidel
2014/11/20 20:40:31
You have to add this boilerplate so that RefCounte
abarth-chromium
2014/11/20 20:47:57
Yep. In Blink, we do the opposite (i.e., we make
|
| + ~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_ |