| 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 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "caching_bitmap_canvas_layer_texture_updater.h" | 7 #include "caching_bitmap_canvas_layer_texture_updater.h" |
| 8 | 8 |
| 9 #include "LayerPainterChromium.h" | 9 #include "LayerPainterChromium.h" |
| 10 #include "skia/ext/platform_canvas.h" | 10 #include "skia/ext/platform_canvas.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 PassRefPtr<CachingBitmapCanvasLayerTextureUpdater> | 14 scoped_refptr<CachingBitmapCanvasLayerTextureUpdater> |
| 15 CachingBitmapCanvasLayerTextureUpdater::Create( | 15 CachingBitmapCanvasLayerTextureUpdater::Create( |
| 16 scoped_ptr<LayerPainterChromium> painter) { | 16 scoped_ptr<LayerPainterChromium> painter) { |
| 17 return adoptRef(new CachingBitmapCanvasLayerTextureUpdater(painter.Pass())); | 17 return make_scoped_refptr(new CachingBitmapCanvasLayerTextureUpdater( |
| 18 painter.Pass())); |
| 18 } | 19 } |
| 19 | 20 |
| 20 CachingBitmapCanvasLayerTextureUpdater::CachingBitmapCanvasLayerTextureUpdater( | 21 CachingBitmapCanvasLayerTextureUpdater::CachingBitmapCanvasLayerTextureUpdater( |
| 21 scoped_ptr<LayerPainterChromium> painter) | 22 scoped_ptr<LayerPainterChromium> painter) |
| 22 : BitmapCanvasLayerTextureUpdater(painter.Pass()), | 23 : BitmapCanvasLayerTextureUpdater(painter.Pass()), |
| 23 pixels_did_change_(false) { | 24 pixels_did_change_(false) { |
| 24 } | 25 } |
| 25 | 26 |
| 27 CachingBitmapCanvasLayerTextureUpdater:: |
| 28 ~CachingBitmapCanvasLayerTextureUpdater() |
| 29 { |
| 30 } |
| 31 |
| 26 void CachingBitmapCanvasLayerTextureUpdater::prepareToUpdate( | 32 void CachingBitmapCanvasLayerTextureUpdater::prepareToUpdate( |
| 27 const IntRect& content_rect, | 33 const IntRect& content_rect, |
| 28 const IntSize& tile_size, | 34 const IntSize& tile_size, |
| 29 float contents_width_scale, | 35 float contents_width_scale, |
| 30 float contents_height_scale, | 36 float contents_height_scale, |
| 31 IntRect& resulting_opaque_rect, | 37 IntRect& resulting_opaque_rect, |
| 32 CCRenderingStats& stats) { | 38 CCRenderingStats& stats) { |
| 33 BitmapCanvasLayerTextureUpdater::prepareToUpdate(content_rect, | 39 BitmapCanvasLayerTextureUpdater::prepareToUpdate(content_rect, |
| 34 tile_size, | 40 tile_size, |
| 35 contents_width_scale, | 41 contents_width_scale, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 50 if (pixels_did_change_) | 56 if (pixels_did_change_) |
| 51 new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config()); | 57 new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config()); |
| 52 } | 58 } |
| 53 | 59 |
| 54 bool CachingBitmapCanvasLayerTextureUpdater::pixelsDidChange() const | 60 bool CachingBitmapCanvasLayerTextureUpdater::pixelsDidChange() const |
| 55 { | 61 { |
| 56 return pixels_did_change_; | 62 return pixels_did_change_; |
| 57 } | 63 } |
| 58 | 64 |
| 59 } // namespace cc | 65 } // namespace cc |
| OLD | NEW |