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