aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkCanvas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkCanvas.cpp')
-rw-r--r--src/core/SkCanvas.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 7325c025ec..d5a2d1559c 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -508,6 +508,10 @@ SkDevice* SkCanvas::setDevice(SkDevice* device) {
things like lock/unlock their pixels, etc.
*/
if (device) {
+ // To mirror our (SkDevice*) constructor, we grab the factory from the
+ // new device
+ this->setDeviceFactory(device->getDeviceFactory());
+
device->lockPixels();
}
if (rootDevice) {