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 "third_party/skia/include/core/SkBitmap.h" |
11 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
12 | 13 |
13 namespace sky { | 14 namespace sky { |
14 class LayerHost; | 15 class LayerHost; |
15 | 16 |
16 class Layer : public base::RefCounted<Layer> { | 17 class Layer : public base::RefCounted<Layer> { |
17 public: | 18 public: |
18 explicit Layer(LayerClient* client); | 19 explicit Layer(LayerClient* client, bool is_testing_); |
19 | 20 |
20 void ClearClient(); | 21 void ClearClient(); |
21 | 22 |
22 void SetSize(const gfx::Size& size); | 23 void SetSize(const gfx::Size& size); |
| 24 std::string GetPixelsForTesting(); |
23 void Display(); | 25 void Display(); |
24 | 26 |
25 scoped_ptr<mojo::GLTexture> GetTexture(); | 27 scoped_ptr<mojo::GLTexture> GetTexture(); |
26 | 28 |
27 const gfx::Size& size() const { return size_; } | 29 const gfx::Size& size() const { return size_; } |
28 | 30 |
29 void set_host(LayerHost* host) { host_ = host; } | 31 void set_host(LayerHost* host) { host_ = host; } |
30 | 32 |
31 private: | 33 private: |
32 friend class base::RefCounted<Layer>; | 34 friend class base::RefCounted<Layer>; |
33 ~Layer(); | 35 ~Layer(); |
34 | 36 |
35 LayerClient* client_; | 37 LayerClient* client_; |
36 LayerHost* host_; | 38 LayerHost* host_; |
37 gfx::Size size_; | 39 gfx::Size size_; |
38 | 40 SkBitmap bitmap_; |
39 scoped_ptr<mojo::GLTexture> texture_; | 41 scoped_ptr<mojo::GLTexture> texture_; |
| 42 bool is_testing_; |
40 | 43 |
41 DISALLOW_COPY_AND_ASSIGN(Layer); | 44 DISALLOW_COPY_AND_ASSIGN(Layer); |
42 }; | 45 }; |
43 | 46 |
44 } // namespace sky | 47 } // namespace sky |
45 | 48 |
46 #endif // SKY_COMPOSITOR_LAYER_H_ | 49 #endif // SKY_COMPOSITOR_LAYER_H_ |
OLD | NEW |