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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: win fix after rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/pixel_comparator.cc ('k') | chrome/browser/android/thumbnail/thumbnail_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 9d04554dcc57cf6d22f6eb4c4bfcac65ad194d65..1a94134c390a5c3e4554557032ff5eadb1d545aa 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3888,9 +3888,7 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
gfx::ColorSpace::CreateSRGB());
if (!scaled) {
- AutoLockUIResourceBitmap bitmap_lock(bitmap);
- auto* pixels = bitmap_lock.GetPixels();
- resource_provider_->CopyToResource(id, pixels, source_size);
+ resource_provider_->CopyToResource(id, bitmap.GetPixels(), source_size);
} else {
// Only support auto-resizing for N32 textures (since this is primarily for
// scrollbars). Users of other types need to ensure they are not too big.
@@ -3907,10 +3905,9 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
source_size.width(), source_size.height(), kPremul_SkAlphaType);
int row_bytes = source_size.width() * 4;
- AutoLockUIResourceBitmap bitmap_lock(bitmap);
SkBitmap source_bitmap;
source_bitmap.setInfo(info, row_bytes);
- source_bitmap.setPixels(const_cast<uint8_t*>(bitmap_lock.GetPixels()));
+ source_bitmap.setPixels(const_cast<uint8_t*>(bitmap.GetPixels()));
// This applies the scale to draw the |bitmap| into |scaled_bitmap|.
SkBitmap scaled_bitmap;
@@ -3924,7 +3921,6 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
scaled_canvas.clear(SK_ColorTRANSPARENT);
scaled_canvas.drawBitmap(source_bitmap, 0, 0);
- SkAutoLockPixels scaled_bitmap_lock(scaled_bitmap);
auto* pixels = static_cast<uint8_t*>(scaled_bitmap.getPixels());
resource_provider_->CopyToResource(id, pixels, upload_size);
}
« no previous file with comments | « cc/test/pixel_comparator.cc ('k') | chrome/browser/android/thumbnail/thumbnail_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698