aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2012-05-01 12:54:21 -0400
committerDerek Sollenberger <djsollen@google.com>2012-05-01 12:54:21 -0400
commitd9689beb7fce225abbaa78063d46717ec92b19fd (patch)
tree0a8afa4909cc41fb8d3b9055e585aad96507336f /tests
parentc0b4fa78738acf9ad587eb9fcbc2021be9a3ee77 (diff)
downloadexternal_skia-d9689beb7fce225abbaa78063d46717ec92b19fd.zip
external_skia-d9689beb7fce225abbaa78063d46717ec92b19fd.tar.gz
external_skia-d9689beb7fce225abbaa78063d46717ec92b19fd.tar.bz2
Fix SkNWayCanvas to prevent crashes by setting up a device
This is a cherry-pick of two CL's from upstream Skia: https://codereview.appspot.com/6092056/ https://codereview.appspot.com/6131062/ bug: 6400332 Change-Id: Ia833e7c0d4fd6e21a06980653450095176f5bd42
Diffstat (limited to 'tests')
-rw-r--r--tests/CanvasTest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 7cafda2..76573ed 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -691,7 +691,8 @@ static void TestNWayCanvasStateConsistency(
SkDevice indirectDevice2(indirectStore2);
SkCanvas indirectCanvas2(&indirectDevice2);
- SkNWayCanvas nWayCanvas;
+ SkISize canvasSize = referenceCanvas.getDeviceSize();
+ SkNWayCanvas nWayCanvas(canvasSize.width(), canvasSize.height());
nWayCanvas.addCanvas(&indirectCanvas1);
nWayCanvas.addCanvas(&indirectCanvas2);