| 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 | 5 |
| 6 #ifndef BitmapContentLayerUpdater_h | 6 #ifndef BitmapContentLayerUpdater_h |
| 7 #define BitmapContentLayerUpdater_h | 7 #define BitmapContentLayerUpdater_h |
| 8 | 8 |
| 9 #include "cc/cc_export.h" |
| 9 #include "cc/content_layer_updater.h" | 10 #include "cc/content_layer_updater.h" |
| 10 | 11 |
| 11 class SkCanvas; | 12 class SkCanvas; |
| 12 | 13 |
| 13 namespace cc { | 14 namespace cc { |
| 14 | 15 |
| 15 class LayerPainter; | 16 class LayerPainter; |
| 16 | 17 |
| 17 // This class rasterizes the contentRect into a skia bitmap canvas. It then upda
tes | 18 // This class rasterizes the contentRect into a skia bitmap canvas. It then upda
tes |
| 18 // textures by copying from the canvas into the texture, using MapSubImage if | 19 // textures by copying from the canvas into the texture, using MapSubImage if |
| 19 // possible. | 20 // possible. |
| 20 class BitmapContentLayerUpdater : public ContentLayerUpdater { | 21 class CC_EXPORT BitmapContentLayerUpdater : public ContentLayerUpdater { |
| 21 public: | 22 public: |
| 22 class Resource : public LayerUpdater::Resource { | 23 class Resource : public LayerUpdater::Resource { |
| 23 public: | 24 public: |
| 24 Resource(BitmapContentLayerUpdater*, scoped_ptr<PrioritizedTexture>); | 25 Resource(BitmapContentLayerUpdater*, scoped_ptr<PrioritizedTexture>); |
| 25 virtual ~Resource(); | 26 virtual ~Resource(); |
| 26 | 27 |
| 27 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c
onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; | 28 virtual void update(ResourceUpdateQueue&, const gfx::Rect& sourceRect, c
onst gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE; |
| 28 | 29 |
| 29 private: | 30 private: |
| 30 BitmapContentLayerUpdater* updater() { return m_updater; } | 31 BitmapContentLayerUpdater* updater() { return m_updater; } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 45 virtual ~BitmapContentLayerUpdater(); | 46 virtual ~BitmapContentLayerUpdater(); |
| 46 | 47 |
| 47 scoped_ptr<SkCanvas> m_canvas; | 48 scoped_ptr<SkCanvas> m_canvas; |
| 48 gfx::Size m_canvasSize; | 49 gfx::Size m_canvasSize; |
| 49 bool m_opaque; | 50 bool m_opaque; |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 } // namespace cc | 53 } // namespace cc |
| 53 | 54 |
| 54 #endif // BitmapContentLayerUpdater_h | 55 #endif // BitmapContentLayerUpdater_h |
| OLD | NEW |