| 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_VIEWER_COMPOSITOR_LAYER_H_ | |
| 6 #define SKY_VIEWER_COMPOSITOR_LAYER_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "mojo/gpu/gl_texture.h" | |
| 10 #include "services/sky/compositor/layer_client.h" | |
| 11 #include "services/sky/compositor/rasterizer.h" | |
| 12 #include "skia/ext/refptr.h" | |
| 13 #include "third_party/skia/include/core/SkPicture.h" | |
| 14 #include "ui/gfx/geometry/rect.h" | |
| 15 | |
| 16 namespace sky { | |
| 17 | |
| 18 class LayerHost; | |
| 19 | |
| 20 class Layer : public base::RefCounted<Layer> { | |
| 21 public: | |
| 22 explicit Layer(LayerClient* client); | |
| 23 | |
| 24 void SetSize(const gfx::Size& size); | |
| 25 void Display(); | |
| 26 | |
| 27 scoped_ptr<mojo::GLTexture> GetTexture(); | |
| 28 | |
| 29 const gfx::Size& size() const { return size_; } | |
| 30 | |
| 31 void set_rasterizer(scoped_ptr<Rasterizer> rasterizer) { | |
| 32 rasterizer_ = rasterizer.Pass(); | |
| 33 } | |
| 34 | |
| 35 private: | |
| 36 friend class base::RefCounted<Layer>; | |
| 37 ~Layer(); | |
| 38 | |
| 39 skia::RefPtr<SkPicture> RecordPicture(); | |
| 40 | |
| 41 LayerClient* client_; | |
| 42 gfx::Size size_; | |
| 43 scoped_ptr<mojo::GLTexture> texture_; | |
| 44 scoped_ptr<Rasterizer> rasterizer_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(Layer); | |
| 47 }; | |
| 48 | |
| 49 } // namespace sky | |
| 50 | |
| 51 #endif // SKY_VIEWER_COMPOSITOR_LAYER_H_ | |
| OLD | NEW |