OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ImageLayerUpdater_h |
| 6 #define ImageLayerUpdater_h |
| 7 |
| 8 #include "config.h" |
| 9 |
| 10 #include "cc/layer_updater.h" |
| 11 |
| 12 namespace cc { |
| 13 |
| 14 class ResourceUpdateQueue; |
| 15 |
| 16 class ImageLayerUpdater : public LayerUpdater { |
| 17 public: |
| 18 class Resource : public LayerUpdater::Resource { |
| 19 public: |
| 20 Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedTexture> text
ure) |
| 21 : LayerUpdater::Resource(texture.Pass()) |
| 22 , m_updater(updater) |
| 23 { |
| 24 } |
| 25 |
| 26 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c
onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; |
| 27 |
| 28 private: |
| 29 ImageLayerUpdater* m_updater; |
| 30 }; |
| 31 |
| 32 static scoped_refptr<ImageLayerUpdater> create(); |
| 33 |
| 34 virtual scoped_ptr<LayerUpdater::Resource> createResource( |
| 35 PrioritizedTextureManager*) OVERRIDE; |
| 36 |
| 37 void updateTexture(ResourceUpdateQueue&, PrioritizedTexture*, const gfx::Rec
t& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate); |
| 38 |
| 39 void setBitmap(const SkBitmap&); |
| 40 |
| 41 private: |
| 42 ImageLayerUpdater() { } |
| 43 virtual ~ImageLayerUpdater() { } |
| 44 |
| 45 SkBitmap m_bitmap; |
| 46 }; |
| 47 |
| 48 } |
| 49 |
| 50 #endif |
OLD | NEW |