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

Unified Diff: ui/gfx/canvas.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 | « ui/gfx/blit_unittest.cc ('k') | ui/gfx/codec/png_codec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index d9f66426c5f0c429f7a03703eda1f313038e00a1..31ef57fbd294b02568e9fa28a36075637447d3ca 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -514,15 +514,7 @@ void Canvas::Transform(const gfx::Transform& transform) {
SkBitmap Canvas::GetBitmap() const {
DCHECK(bitmap_);
- SkBitmap bitmap = bitmap_.value();
- // When the bitmap is copied, it shares the underlying pixelref, but doesn't
- // initialize pixels unless they are locked. Hence, ensure that the returned
- // bitmap keeps the pixelref alive by locking it. Note that the dtor of
- // SkBitmap will unlock the pixelrefs, so this won't leak. Also note that
- // moving SkBitmap retains the same lock as the source, so the caller
- // will receive a locked-pixels bitmap.
- bitmap.lockPixels();
- return bitmap;
+ return bitmap_.value();
}
bool Canvas::IntersectsClipRect(const SkRect& rect) {
« no previous file with comments | « ui/gfx/blit_unittest.cc ('k') | ui/gfx/codec/png_codec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698