Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: cc/caching_bitmap_content_layer_updater.cc

Issue 11609002: cc: Create a cc::ScrollbarThemePainter and an adapter class in compositor bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: notry Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/DEPS ('k') | cc/cc_tests.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "caching_bitmap_content_layer_updater.h" 5 #include "caching_bitmap_content_layer_updater.h"
6 6
7 #include "cc/layer_painter.h" 7 #include "cc/layer_painter.h"
8 #include "skia/ext/platform_canvas.h" 8 #include "skia/ext/platform_canvas.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 16 matching lines...) Expand all
27 { 27 {
28 } 28 }
29 29
30 void CachingBitmapContentLayerUpdater::prepareToUpdate( 30 void CachingBitmapContentLayerUpdater::prepareToUpdate(
31 const gfx::Rect& content_rect, 31 const gfx::Rect& content_rect,
32 const gfx::Size& tile_size, 32 const gfx::Size& tile_size,
33 float contents_width_scale, 33 float contents_width_scale,
34 float contents_height_scale, 34 float contents_height_scale,
35 gfx::Rect& resulting_opaque_rect, 35 gfx::Rect& resulting_opaque_rect,
36 RenderingStats& stats) { 36 RenderingStats& stats) {
37 BitmapContentLayerUpdater::prepareToUpdate(content_rect, 37 BitmapContentLayerUpdater::prepareToUpdate(
38 tile_size, 38 content_rect,
39 contents_width_scale, 39 tile_size,
40 contents_height_scale, 40 contents_width_scale,
41 resulting_opaque_rect, 41 contents_height_scale,
42 stats); 42 resulting_opaque_rect,
43 stats);
43 44
44 const SkBitmap& new_bitmap = m_canvas->getDevice()->accessBitmap(false); 45 const SkBitmap& new_bitmap = m_canvas->getDevice()->accessBitmap(false);
45 SkAutoLockPixels lock(new_bitmap); 46 SkAutoLockPixels lock(new_bitmap);
46 DCHECK(new_bitmap.bytesPerPixel() > 0); 47 DCHECK(new_bitmap.bytesPerPixel() > 0);
47 pixels_did_change_ = new_bitmap.config() != cached_bitmap_.config() || 48 pixels_did_change_ = new_bitmap.config() != cached_bitmap_.config() ||
48 new_bitmap.height() != cached_bitmap_.height() || 49 new_bitmap.height() != cached_bitmap_.height() ||
49 new_bitmap.width() != cached_bitmap_.width() || 50 new_bitmap.width() != cached_bitmap_.width() ||
50 memcmp(new_bitmap.getPixels(), 51 memcmp(new_bitmap.getPixels(),
51 cached_bitmap_.getPixels(), 52 cached_bitmap_.getPixels(),
52 new_bitmap.getSafeSize()); 53 new_bitmap.getSafeSize());
53 54
54 if (pixels_did_change_) 55 if (pixels_did_change_)
55 new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config()); 56 new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config());
56 } 57 }
57 58
58 bool CachingBitmapContentLayerUpdater::pixelsDidChange() const 59 bool CachingBitmapContentLayerUpdater::pixelsDidChange() const
59 { 60 {
60 return pixels_did_change_; 61 return pixels_did_change_;
61 } 62 }
62 63
63 } // namespace cc 64 } // namespace cc
OLDNEW
« no previous file with comments | « cc/DEPS ('k') | cc/cc_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698