OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Test.h" | |
9 #include "SamplePipeControllers.h" | 8 #include "SamplePipeControllers.h" |
10 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
11 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
12 #include "SkGPipe.h" | 11 #include "SkGPipe.h" |
13 #include "SkPaint.h" | 12 #include "SkPaint.h" |
14 #include "SkShader.h" | 13 #include "SkShader.h" |
| 14 #include "Test.h" |
15 | 15 |
16 // Ensures that the pipe gracefully handles drawing an invalid bitmap. | 16 // Ensures that the pipe gracefully handles drawing an invalid bitmap. |
17 static void testDrawingBadBitmap(SkCanvas* pipeCanvas) { | 17 static void testDrawingBadBitmap(SkCanvas* pipeCanvas) { |
18 SkBitmap badBitmap; | 18 SkBitmap badBitmap; |
19 badBitmap.setConfig(SkBitmap::kNo_Config, 5, 5); | 19 badBitmap.setConfig(SkBitmap::kNo_Config, 5, 5); |
20 pipeCanvas->drawBitmap(badBitmap, 0, 0); | 20 pipeCanvas->drawBitmap(badBitmap, 0, 0); |
21 } | 21 } |
22 | 22 |
23 // Ensure that pipe gracefully handles attempting to draw after endRecording is
called on the | 23 // Ensure that pipe gracefully handles attempting to draw after endRecording is
called on the |
24 // SkGPipeWriter. | 24 // SkGPipeWriter. |
(...skipping 23 matching lines...) Expand all Loading... |
48 SkCanvas canvas(bitmap); | 48 SkCanvas canvas(bitmap); |
49 | 49 |
50 PipeController pipeController(&canvas); | 50 PipeController pipeController(&canvas); |
51 SkGPipeWriter writer; | 51 SkGPipeWriter writer; |
52 SkCanvas* pipeCanvas = writer.startRecording(&pipeController); | 52 SkCanvas* pipeCanvas = writer.startRecording(&pipeController); |
53 testDrawingBadBitmap(pipeCanvas); | 53 testDrawingBadBitmap(pipeCanvas); |
54 writer.endRecording(); | 54 writer.endRecording(); |
55 | 55 |
56 testDrawingAfterEndRecording(&canvas); | 56 testDrawingAfterEndRecording(&canvas); |
57 } | 57 } |
OLD | NEW |