OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SKY_COMPOSITOR_LAYER_H_ | |
6 #define SKY_COMPOSITOR_LAYER_H_ | |
7 | |
8 #include "base/memory/ref_counted.h" | |
9 #include "mojo/gpu/gl_texture.h" | |
10 #include "sky/compositor/layer_client.h" | |
11 #include "ui/gfx/geometry/rect.h" | |
12 | |
13 namespace sky { | |
14 class LayerHost; | |
15 | |
16 class Layer : public base::RefCounted<Layer> { | |
17 public: | |
18 explicit Layer(LayerClient* client); | |
19 | |
20 void ClearClient(); | |
21 | |
22 void SetSize(const gfx::Size& size); | |
23 void Display(); | |
24 | |
25 scoped_ptr<mojo::GLTexture> GetTexture(); | |
26 | |
27 const gfx::Size& size() const { return size_; } | |
28 | |
29 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.
| |
30 | |
31 private: | |
32 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
| |
33 ~Layer(); | |
34 | |
35 LayerClient* client_; | |
36 LayerHost* host_; | |
37 gfx::Size size_; | |
38 | |
39 scoped_ptr<mojo::GLTexture> texture_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(Layer); | |
42 }; | |
43 | |
44 } // namespace sky | |
45 | |
46 #endif // SKY_COMPOSITOR_LAYER_H_ | |
OLD | NEW |