OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CC_IMAGE_LAYER_UPDATER_H_ | 5 #ifndef CC_IMAGE_LAYER_UPDATER_H_ |
6 #define CC_IMAGE_LAYER_UPDATER_H_ | 6 #define CC_IMAGE_LAYER_UPDATER_H_ |
7 | 7 |
8 #include "cc/layer_updater.h" | 8 #include "cc/layer_updater.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" |
9 | 10 |
10 namespace cc { | 11 namespace cc { |
11 | 12 |
12 class ResourceUpdateQueue; | 13 class ResourceUpdateQueue; |
13 | 14 |
14 class ImageLayerUpdater : public LayerUpdater { | 15 class ImageLayerUpdater : public LayerUpdater { |
15 public: | 16 public: |
16 class Resource : public LayerUpdater::Resource { | 17 class Resource : public LayerUpdater::Resource { |
17 public: | 18 public: |
18 Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedResource> tex
ture) | 19 Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedResource> tex
ture); |
19 : LayerUpdater::Resource(texture.Pass()) | 20 virtual ~Resource(); |
20 , m_updater(updater) | |
21 { | |
22 } | |
23 | 21 |
24 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c
onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; | 22 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c
onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; |
25 | 23 |
26 private: | 24 private: |
27 ImageLayerUpdater* m_updater; | 25 ImageLayerUpdater* m_updater; |
28 }; | 26 }; |
29 | 27 |
30 static scoped_refptr<ImageLayerUpdater> create(); | 28 static scoped_refptr<ImageLayerUpdater> create(); |
31 | 29 |
32 virtual scoped_ptr<LayerUpdater::Resource> createResource( | 30 virtual scoped_ptr<LayerUpdater::Resource> createResource( |
33 PrioritizedResourceManager*) OVERRIDE; | 31 PrioritizedResourceManager*) OVERRIDE; |
34 | 32 |
35 void updateTexture(ResourceUpdateQueue&, PrioritizedResource*, const gfx::Re
ct& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate); | 33 void updateTexture(ResourceUpdateQueue&, PrioritizedResource*, const gfx::Re
ct& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate); |
36 | 34 |
37 void setBitmap(const SkBitmap&); | 35 void setBitmap(const SkBitmap&); |
38 | 36 |
39 private: | 37 private: |
40 ImageLayerUpdater() { } | 38 ImageLayerUpdater() { } |
41 virtual ~ImageLayerUpdater() { } | 39 virtual ~ImageLayerUpdater() { } |
42 | 40 |
43 SkBitmap m_bitmap; | 41 SkBitmap m_bitmap; |
44 }; | 42 }; |
45 | 43 |
46 } // namespace cc | 44 } // namespace cc |
47 | 45 |
48 #endif // CC_IMAGE_LAYER_UPDATER_H_ | 46 #endif // CC_IMAGE_LAYER_UPDATER_H_ |
OLD | NEW |