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 PassRefPtr<CachingBitmapCanvasLayerTextureUpdater> |
15 CachingBitmapCanvasLayerTextureUpdater::Create( | 15 CachingBitmapCanvasLayerTextureUpdater::Create( |
16 PassOwnPtr<LayerPainterChromium> painter) { | 16 scoped_ptr<LayerPainterChromium> painter) { |
17 return adoptRef(new CachingBitmapCanvasLayerTextureUpdater(painter)); | 17 return adoptRef(new CachingBitmapCanvasLayerTextureUpdater(painter.Pass())); |
18 } | 18 } |
19 | 19 |
20 CachingBitmapCanvasLayerTextureUpdater::CachingBitmapCanvasLayerTextureUpdater( | 20 CachingBitmapCanvasLayerTextureUpdater::CachingBitmapCanvasLayerTextureUpdater( |
21 PassOwnPtr<LayerPainterChromium> painter) | 21 scoped_ptr<LayerPainterChromium> painter) |
22 : BitmapCanvasLayerTextureUpdater(painter), | 22 : BitmapCanvasLayerTextureUpdater(painter.Pass()), |
23 pixels_did_change_(false) { | 23 pixels_did_change_(false) { |
24 } | 24 } |
25 | 25 |
26 void CachingBitmapCanvasLayerTextureUpdater::prepareToUpdate( | 26 void CachingBitmapCanvasLayerTextureUpdater::prepareToUpdate( |
27 const IntRect& content_rect, | 27 const IntRect& content_rect, |
28 const IntSize& tile_size, | 28 const IntSize& tile_size, |
29 float contents_width_scale, | 29 float contents_width_scale, |
30 float contents_height_scale, | 30 float contents_height_scale, |
31 IntRect& resulting_opaque_rect, | 31 IntRect& resulting_opaque_rect, |
32 CCRenderingStats& stats) { | 32 CCRenderingStats& stats) { |
(...skipping 17 matching lines...) Expand all Loading... |
50 if (pixels_did_change_) | 50 if (pixels_did_change_) |
51 new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config()); | 51 new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config()); |
52 } | 52 } |
53 | 53 |
54 bool CachingBitmapCanvasLayerTextureUpdater::pixelsDidChange() const | 54 bool CachingBitmapCanvasLayerTextureUpdater::pixelsDidChange() const |
55 { | 55 { |
56 return pixels_did_change_; | 56 return pixels_did_change_; |
57 } | 57 } |
58 | 58 |
59 } // namespace cc | 59 } // namespace cc |
OLD | NEW |