| 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_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ | 5 #ifndef CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ |
| 6 #define CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ | 6 #define CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ |
| 7 | 7 |
| 8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
| 9 #include "cc/resources/content_layer_updater.h" | 9 #include "cc/resources/content_layer_updater.h" |
| 10 #include "skia/ext/refptr.h" | 10 #include "skia/ext/refptr.h" |
| 11 #include "third_party/skia/include/core/SkBitmap.h" |
| 11 | 12 |
| 12 class SkCanvas; | 13 class SkCanvas; |
| 13 | 14 |
| 14 namespace cc { | 15 namespace cc { |
| 15 | 16 |
| 16 class LayerPainter; | 17 class LayerPainter; |
| 17 class RenderingStatsInstrumenation; | 18 class RenderingStatsInstrumenation; |
| 18 | 19 |
| 19 // This class rasterizes the content_rect into a skia bitmap canvas. It then | 20 // This class rasterizes the content_rect into a skia bitmap canvas. It then |
| 20 // updates textures by copying from the canvas into the texture, using | 21 // updates textures by copying from the canvas into the texture, using |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual void SetOpaque(bool opaque) OVERRIDE; | 59 virtual void SetOpaque(bool opaque) OVERRIDE; |
| 59 virtual void ReduceMemoryUsage() OVERRIDE; | 60 virtual void ReduceMemoryUsage() OVERRIDE; |
| 60 | 61 |
| 61 protected: | 62 protected: |
| 62 BitmapContentLayerUpdater( | 63 BitmapContentLayerUpdater( |
| 63 scoped_ptr<LayerPainter> painter, | 64 scoped_ptr<LayerPainter> painter, |
| 64 RenderingStatsInstrumentation* stats_instrumenation, | 65 RenderingStatsInstrumentation* stats_instrumenation, |
| 65 int layer_id); | 66 int layer_id); |
| 66 virtual ~BitmapContentLayerUpdater(); | 67 virtual ~BitmapContentLayerUpdater(); |
| 67 | 68 |
| 69 SkBitmap bitmap_backing_; |
| 68 skia::RefPtr<SkCanvas> canvas_; | 70 skia::RefPtr<SkCanvas> canvas_; |
| 69 gfx::Size canvas_size_; | 71 gfx::Size canvas_size_; |
| 70 bool opaque_; | 72 bool opaque_; |
| 71 | 73 |
| 72 private: | 74 private: |
| 73 DISALLOW_COPY_AND_ASSIGN(BitmapContentLayerUpdater); | 75 DISALLOW_COPY_AND_ASSIGN(BitmapContentLayerUpdater); |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 } // namespace cc | 78 } // namespace cc |
| 77 | 79 |
| 78 #endif // CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ | 80 #endif // CC_RESOURCES_BITMAP_CONTENT_LAYER_UPDATER_H_ |
| OLD | NEW |