| 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 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 class ResourceUpdateQueue; | 13 class ResourceUpdateQueue; |
| 14 | 14 |
| 15 class ImageLayerUpdater : public LayerUpdater { | 15 class ImageLayerUpdater : public LayerUpdater { |
| 16 public: | 16 public: |
| 17 class Resource : public LayerUpdater::Resource { | 17 class Resource : public LayerUpdater::Resource { |
| 18 public: | 18 public: |
| 19 Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedResource> tex
ture); | 19 Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedResource> tex
ture); |
| 20 virtual ~Resource(); | 20 virtual ~Resource(); |
| 21 | 21 |
| 22 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; |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 ImageLayerUpdater* m_updater; | 25 ImageLayerUpdater* m_updater; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 static scoped_refptr<ImageLayerUpdater> create(); | 28 static scoped_refptr<ImageLayerUpdater> create(); |
| 29 | 29 |
| 30 virtual scoped_ptr<LayerUpdater::Resource> createResource( | 30 virtual scoped_ptr<LayerUpdater::Resource> createResource( |
| 31 PrioritizedResourceManager*) OVERRIDE; | 31 PrioritizedResourceManager*) OVERRIDE; |
| 32 | 32 |
| 33 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); |
| 34 | 34 |
| 35 void setBitmap(const SkBitmap&); | 35 void setBitmap(const SkBitmap&); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 ImageLayerUpdater() { } | 38 ImageLayerUpdater() { } |
| 39 virtual ~ImageLayerUpdater() { } | 39 virtual ~ImageLayerUpdater() { } |
| 40 | 40 |
| 41 SkBitmap m_bitmap; | 41 SkBitmap m_bitmap; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace cc | 44 } // namespace cc |
| 45 | 45 |
| 46 #endif // CC_IMAGE_LAYER_UPDATER_H_ | 46 #endif // CC_IMAGE_LAYER_UPDATER_H_ |
| OLD | NEW |