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

Unified Diff: src/utils/SkDeferredCanvas.cpp

Issue 15594004: Fixing deferred canvases so that they do not return deferred devices on createCompatibleDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 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 | « no previous file | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDeferredCanvas.cpp
===================================================================
--- src/utils/SkDeferredCanvas.cpp (revision 9222)
+++ src/utils/SkDeferredCanvas.cpp (working copy)
@@ -475,12 +475,11 @@
// Save layer usage not supported, and not required by SkDeferredCanvas.
SkASSERT(usage != kSaveLayer_Usage);
// Create a compatible non-deferred device.
- SkAutoTUnref<SkDevice> compatibleDevice
- (immediateDevice()->createCompatibleDevice(config, width, height,
- isOpaque));
- DeferredDevice* device = SkNEW_ARGS(DeferredDevice, (compatibleDevice));
- device->setNotificationClient(fNotificationClient);
- return device;
+ // We do not create a deferred device because we know the new device
+ // will not be used with a deferred canvas (there is no API for that).
+ // And connecting a DeferredDevice to non-deferred canvas can result
+ // in unpredictable behavior.
+ return immediateDevice()->createCompatibleDevice(config, width, height, isOpaque);
}
bool DeferredDevice::onReadPixels(
« no previous file with comments | « no previous file | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698