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

Side by Side Diff: cc/caching_bitmap_canvas_layer_texture_updater.cc

Issue 11192030: cc: Switch to Chromium DCHECKs LOGs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcheck and ndebug Created 8 years, 2 months 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
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 "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 "cc/layer_painter.h" 9 #include "cc/layer_painter.h"
10 #include "skia/ext/platform_canvas.h" 10 #include "skia/ext/platform_canvas.h"
(...skipping 27 matching lines...) Expand all
38 CCRenderingStats& stats) { 38 CCRenderingStats& stats) {
39 BitmapCanvasLayerTextureUpdater::prepareToUpdate(content_rect, 39 BitmapCanvasLayerTextureUpdater::prepareToUpdate(content_rect,
40 tile_size, 40 tile_size,
41 contents_width_scale, 41 contents_width_scale,
42 contents_height_scale, 42 contents_height_scale,
43 resulting_opaque_rect, 43 resulting_opaque_rect,
44 stats); 44 stats);
45 45
46 const SkBitmap& new_bitmap = m_canvas->getDevice()->accessBitmap(false); 46 const SkBitmap& new_bitmap = m_canvas->getDevice()->accessBitmap(false);
47 SkAutoLockPixels lock(new_bitmap); 47 SkAutoLockPixels lock(new_bitmap);
48 ASSERT(new_bitmap.bytesPerPixel() > 0); 48 DCHECK(new_bitmap.bytesPerPixel() > 0);
jamesr 2012/10/17 18:51:51 DCHECK_GT
49 pixels_did_change_ = new_bitmap.config() != cached_bitmap_.config() || 49 pixels_did_change_ = new_bitmap.config() != cached_bitmap_.config() ||
50 new_bitmap.height() != cached_bitmap_.height() || 50 new_bitmap.height() != cached_bitmap_.height() ||
51 new_bitmap.width() != cached_bitmap_.width() || 51 new_bitmap.width() != cached_bitmap_.width() ||
52 memcmp(new_bitmap.getPixels(), 52 memcmp(new_bitmap.getPixels(),
53 cached_bitmap_.getPixels(), 53 cached_bitmap_.getPixels(),
54 new_bitmap.getSafeSize()); 54 new_bitmap.getSafeSize());
55 55
56 if (pixels_did_change_) 56 if (pixels_did_change_)
57 new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config()); 57 new_bitmap.deepCopyTo(&cached_bitmap_, new_bitmap.config());
58 } 58 }
59 59
60 bool CachingBitmapCanvasLayerTextureUpdater::pixelsDidChange() const 60 bool CachingBitmapCanvasLayerTextureUpdater::pixelsDidChange() const
61 { 61 {
62 return pixels_did_change_; 62 return pixels_did_change_;
63 } 63 }
64 64
65 } // namespace cc 65 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698