OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 LayerUpdater_h | 5 #ifndef LayerUpdater_h |
6 #define LayerUpdater_h | 6 #define LayerUpdater_h |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "cc/cc_export.h" |
9 #include "cc/prioritized_texture.h" | 10 #include "cc/prioritized_texture.h" |
10 #include "third_party/khronos/GLES2/gl2.h" | 11 #include "third_party/khronos/GLES2/gl2.h" |
11 | 12 |
12 namespace gfx { | 13 namespace gfx { |
13 class Rect; | 14 class Rect; |
14 class Vector2d; | 15 class Vector2d; |
15 } | 16 } |
16 | 17 |
17 namespace cc { | 18 namespace cc { |
18 | 19 |
19 class TextureManager; | 20 class TextureManager; |
20 struct RenderingStats; | 21 struct RenderingStats; |
21 class ResourceUpdateQueue; | 22 class ResourceUpdateQueue; |
22 | 23 |
23 class LayerUpdater : public base::RefCounted<LayerUpdater> { | 24 class CC_EXPORT LayerUpdater : public base::RefCounted<LayerUpdater> { |
24 public: | 25 public: |
25 // Allows updaters to store per-resource update properties. | 26 // Allows updaters to store per-resource update properties. |
26 class Resource { | 27 class CC_EXPORT Resource { |
27 public: | 28 public: |
28 virtual ~Resource(); | 29 virtual ~Resource(); |
29 | 30 |
30 PrioritizedTexture* texture() { return m_texture.get(); } | 31 PrioritizedTexture* texture() { return m_texture.get(); } |
31 void swapTextureWith(scoped_ptr<PrioritizedTexture>& texture) { m_textur
e.swap(texture); } | 32 void swapTextureWith(scoped_ptr<PrioritizedTexture>& texture) { m_textur
e.swap(texture); } |
32 // TODO(reveman): partialUpdate should be a property of this class | 33 // TODO(reveman): partialUpdate should be a property of this class |
33 // instead of an argument passed to update(). | 34 // instead of an argument passed to update(). |
34 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c
onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) = 0; | 35 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c
onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) = 0; |
35 protected: | 36 protected: |
36 explicit Resource(scoped_ptr<PrioritizedTexture> texture); | 37 explicit Resource(scoped_ptr<PrioritizedTexture> texture); |
(...skipping 15 matching lines...) Expand all Loading... |
52 protected: | 53 protected: |
53 virtual ~LayerUpdater() { } | 54 virtual ~LayerUpdater() { } |
54 | 55 |
55 private: | 56 private: |
56 friend class base::RefCounted<LayerUpdater>; | 57 friend class base::RefCounted<LayerUpdater>; |
57 }; | 58 }; |
58 | 59 |
59 } // namespace cc | 60 } // namespace cc |
60 | 61 |
61 #endif // LayerUpdater_h | 62 #endif // LayerUpdater_h |
OLD | NEW |