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

Unified Diff: skia/public/interfaces/bitmap_skbitmap_struct_traits.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
Index: skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
diff --git a/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc b/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
index 35f18be16bce02aed0f2ae89599bcf7901599e83..f5b5550c6798723a4139749d357a94fae3df7a07 100644
--- a/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
+++ b/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
@@ -180,14 +180,12 @@ bool StructTraits<skia::mojom::BitmapDataView, SkBitmap>::Read(
if (data.width() == 0 || data.height() == 0)
return true;
- SkAutoPixmapUnlock pixmap;
mojo::ArrayDataView<uint8_t> data_view;
data.GetPixelDataDataView(&data_view);
if (static_cast<uint32_t>(b->width()) != data.width() ||
static_cast<uint32_t>(b->height()) != data.height() ||
static_cast<uint64_t>(b->rowBytes()) != data.row_bytes() ||
- b->getSize() != data_view.size() || !b->requestLock(&pixmap) ||
- !b->readyToDraw()) {
+ b->getSize() != data_view.size() || !b->readyToDraw()) {
return false;
}
@@ -200,18 +198,4 @@ bool StructTraits<skia::mojom::BitmapDataView, SkBitmap>::Read(
return true;
}
-// static
-void* StructTraits<skia::mojom::BitmapDataView, SkBitmap>::SetUpContext(
- const SkBitmap& b) {
- b.lockPixels();
- return nullptr;
-}
-
-// static
-void StructTraits<skia::mojom::BitmapDataView, SkBitmap>::TearDownContext(
- const SkBitmap& b,
- void* context) {
- b.unlockPixels();
-}
-
} // namespace mojo
« no previous file with comments | « skia/public/interfaces/bitmap_skbitmap_struct_traits.h ('k') | third_party/WebKit/Source/platform/DragImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698