| 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_RESOURCES_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_ | 5 #ifndef CC_RESOURCES_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_ |
| 6 #define CC_RESOURCES_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_ | 6 #define CC_RESOURCES_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "cc/resources/bitmap_content_layer_updater.h" | 9 #include "cc/resources/bitmap_content_layer_updater.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 class CachingBitmapContentLayerUpdater : public BitmapContentLayerUpdater { | 14 class CachingBitmapContentLayerUpdater : public BitmapContentLayerUpdater { |
| 15 public: | 15 public: |
| 16 static scoped_refptr<CachingBitmapContentLayerUpdater> Create( | 16 static scoped_refptr<CachingBitmapContentLayerUpdater> Create( |
| 17 scoped_ptr<LayerPainter>); | 17 scoped_ptr<LayerPainter>, |
| 18 RenderingStatsInstrumentation* stats_instrumentation); |
| 18 | 19 |
| 19 virtual void PrepareToUpdate(gfx::Rect content_rect, | 20 virtual void PrepareToUpdate(gfx::Rect content_rect, |
| 20 gfx::Size tile_size, | 21 gfx::Size tile_size, |
| 21 float contents_width_scale, | 22 float contents_width_scale, |
| 22 float contents_height_scale, | 23 float contents_height_scale, |
| 23 gfx::Rect* resulting_opaque_rect, | 24 gfx::Rect* resulting_opaque_rect, |
| 24 RenderingStats* stats) OVERRIDE; | 25 RenderingStats* stats) OVERRIDE; |
| 25 | 26 |
| 26 bool pixels_did_change() const { | 27 bool pixels_did_change() const { |
| 27 return pixels_did_change_; | 28 return pixels_did_change_; |
| 28 } | 29 } |
| 29 | 30 |
| 30 private: | 31 private: |
| 31 explicit CachingBitmapContentLayerUpdater(scoped_ptr<LayerPainter> painter); | 32 CachingBitmapContentLayerUpdater( |
| 33 scoped_ptr<LayerPainter> painter, |
| 34 RenderingStatsInstrumentation* stats_instrumentation); |
| 32 virtual ~CachingBitmapContentLayerUpdater(); | 35 virtual ~CachingBitmapContentLayerUpdater(); |
| 33 | 36 |
| 34 bool pixels_did_change_; | 37 bool pixels_did_change_; |
| 35 SkBitmap cached_bitmap_; | 38 SkBitmap cached_bitmap_; |
| 36 | 39 |
| 37 DISALLOW_COPY_AND_ASSIGN(CachingBitmapContentLayerUpdater); | 40 DISALLOW_COPY_AND_ASSIGN(CachingBitmapContentLayerUpdater); |
| 38 }; | 41 }; |
| 39 | 42 |
| 40 } // namespace cc | 43 } // namespace cc |
| 41 | 44 |
| 42 #endif // CC_RESOURCES_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_ | 45 #endif // CC_RESOURCES_CACHING_BITMAP_CONTENT_LAYER_UPDATER_H_ |
| OLD | NEW |