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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 2168483003: Deprecate SkDevice::accessBitmap method (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 5 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: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index b91a84a33a05ba7063e79eca56944d82a43137a3..50654305472cd13e2c6e44506c3492b099d47822 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -182,14 +182,9 @@ SkGpuDevice::SkGpuDevice(sk_sp<GrDrawContext> drawContext, int width, int height
, fContext(SkRef(drawContext->accessRenderTarget()->getContext()))
, fRenderTarget(drawContext->renderTarget())
, fDrawContext(std::move(drawContext)) {
+ fSize.set(width, height);
fOpaque = SkToBool(flags & kIsOpaque_Flag);
- SkAlphaType at = fOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
- SkImageInfo info = fRenderTarget->surfacePriv().info(at).makeWH(width, height);
- SkPixelRef* pr = new SkGrPixelRef(info, fRenderTarget.get());
- fLegacyBitmap.setInfo(info);
- fLegacyBitmap.setPixelRef(pr)->unref();
-
if (flags & kNeedClear_Flag) {
this->clearAll();
}
@@ -284,23 +279,11 @@ bool SkGpuDevice::onWritePixels(const SkImageInfo& info, const void* pixels, siz
}
fRenderTarget->writePixels(x, y, info.width(), info.height(), config, pixels, rowBytes, flags);
- // need to bump our genID for compatibility with clients that "know" we have a bitmap
- fLegacyBitmap.notifyPixelsChanged();
-
return true;
}
-const SkBitmap& SkGpuDevice::onAccessBitmap() {
- ASSERT_SINGLE_OWNER
- return fLegacyBitmap;
-}
-
bool SkGpuDevice::onAccessPixels(SkPixmap* pmap) {
ASSERT_SINGLE_OWNER
- // For compatibility with clients the know we're backed w/ a bitmap, and want to inspect its
- // genID. When we can hide/remove that fact, we can eliminate this call to notify.
- // ... ugh.
- fLegacyBitmap.notifyPixelsChanged();
return false;
}
@@ -370,14 +353,6 @@ void SkGpuDevice::replaceDrawContext(bool shouldRetainContent) {
fRenderTarget = newDC->renderTarget();
-#ifdef SK_DEBUG
- SkImageInfo info = fRenderTarget->surfacePriv().info(fOpaque ? kOpaque_SkAlphaType :
- kPremul_SkAlphaType);
- SkASSERT(info == fLegacyBitmap.info());
-#endif
- SkPixelRef* pr = new SkGrPixelRef(fLegacyBitmap.info(), fRenderTarget.get());
- fLegacyBitmap.setPixelRef(pr)->unref();
-
fDrawContext = newDC;
}
« src/gpu/SkGpuDevice.h ('K') | « src/gpu/SkGpuDevice.h ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698