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

Unified Diff: src/core/SkBitmapDevice.cpp

Issue 2180793002: remove fClipStack and attach/deattach-from-canvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: no need for attachToCanvas 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
« no previous file with comments | « include/core/SkDevice.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapDevice.cpp
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index dcdc55bbfbe8bda27803d30996243a14bbd44ed4..4b25e21e862b138e237392c91fc1e78809b2e1ba 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -70,8 +70,10 @@ static bool valid_for_bitmap_device(const SkImageInfo& info,
SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap)
: INHERITED(SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType))
- , fBitmap(bitmap) {
+ , fBitmap(bitmap)
+{
SkASSERT(valid_for_bitmap_device(bitmap.info(), nullptr));
+ fBitmap.lockPixels();
}
SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& info) {
@@ -80,8 +82,10 @@ SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& info) {
SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkSurfaceProps& surfaceProps)
: INHERITED(surfaceProps)
- , fBitmap(bitmap) {
+ , fBitmap(bitmap)
+{
SkASSERT(valid_for_bitmap_device(bitmap.info(), nullptr));
+ fBitmap.lockPixels();
}
SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo,
@@ -183,16 +187,6 @@ bool SkBitmapDevice::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, s
return fBitmap.readPixels(dstInfo, dstPixels, dstRowBytes, x, y);
}
-void SkBitmapDevice::onAttachToCanvas(SkCanvas* canvas) {
- INHERITED::onAttachToCanvas(canvas);
- fBitmap.lockPixels();
-}
-
-void SkBitmapDevice::onDetachFromCanvas() {
- INHERITED::onDetachFromCanvas();
- fBitmap.unlockPixels();
-}
-
///////////////////////////////////////////////////////////////////////////////
void SkBitmapDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) {
« no previous file with comments | « include/core/SkDevice.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698