| 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 CC_BITMAP_SKPICTURE_CONTENT_LAYER_UPDATER_H_ | 5 #ifndef CC_BITMAP_SKPICTURE_CONTENT_LAYER_UPDATER_H_ |
| 6 #define CC_BITMAP_SKPICTURE_CONTENT_LAYER_UPDATER_H_ | 6 #define CC_BITMAP_SKPICTURE_CONTENT_LAYER_UPDATER_H_ |
| 7 | 7 |
| 8 #include "cc/skpicture_content_layer_updater.h" | 8 #include "cc/skpicture_content_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 // This class records the contentRect into an SkPicture, then software rasterize
s | 13 // This class records the contentRect into an SkPicture, then software rasterize
s |
| 14 // the SkPicture into bitmaps for each tile. This implements Settings::perTilePa
inting. | 14 // the SkPicture into bitmaps for each tile. This implements Settings::perTilePa
inting. |
| 15 class BitmapSkPictureContentLayerUpdater : public SkPictureContentLayerUpdater { | 15 class BitmapSkPictureContentLayerUpdater : public SkPictureContentLayerUpdater { |
| 16 public: | 16 public: |
| 17 class Resource : public ContentLayerUpdater::Resource { | 17 class Resource : public ContentLayerUpdater::Resource { |
| 18 public: | 18 public: |
| 19 Resource(BitmapSkPictureContentLayerUpdater*, scoped_ptr<PrioritizedReso
urce>); | 19 Resource(BitmapSkPictureContentLayerUpdater*, scoped_ptr<PrioritizedReso
urce>); |
| 20 | 20 |
| 21 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c
onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; | 21 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c
onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats*) OVERRIDE; |
| 22 | 22 |
| 23 private: | 23 private: |
| 24 BitmapSkPictureContentLayerUpdater* updater() { return m_updater; } | 24 BitmapSkPictureContentLayerUpdater* updater() { return m_updater; } |
| 25 | 25 |
| 26 SkBitmap m_bitmap; | 26 SkBitmap m_bitmap; |
| 27 BitmapSkPictureContentLayerUpdater* m_updater; | 27 BitmapSkPictureContentLayerUpdater* m_updater; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 static scoped_refptr<BitmapSkPictureContentLayerUpdater> create(scoped_ptr<L
ayerPainter>); | 30 static scoped_refptr<BitmapSkPictureContentLayerUpdater> create(scoped_ptr<L
ayerPainter>); |
| 31 | 31 |
| 32 virtual scoped_ptr<LayerUpdater::Resource> createResource(PrioritizedResourc
eManager*) OVERRIDE; | 32 virtual scoped_ptr<LayerUpdater::Resource> createResource(PrioritizedResourc
eManager*) OVERRIDE; |
| 33 void paintContentsRect(SkCanvas*, const gfx::Rect& sourceRect, RenderingStat
s&); | 33 void paintContentsRect(SkCanvas*, const gfx::Rect& sourceRect, RenderingStat
s*); |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 explicit BitmapSkPictureContentLayerUpdater(scoped_ptr<LayerPainter>); | 36 explicit BitmapSkPictureContentLayerUpdater(scoped_ptr<LayerPainter>); |
| 37 virtual ~BitmapSkPictureContentLayerUpdater(); | 37 virtual ~BitmapSkPictureContentLayerUpdater(); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace cc | 40 } // namespace cc |
| 41 | 41 |
| 42 #endif // CC_BITMAP_SKPICTURE_CONTENT_LAYER_UPDATER_H_ | 42 #endif // CC_BITMAP_SKPICTURE_CONTENT_LAYER_UPDATER_H_ |
| OLD | NEW |