| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
| 9 | 9 |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| 11 #include "GrContextFactory.h" | 11 #include "GrContextFactory.h" |
| 12 #include "SkBitmap.h" | 12 #include "SkBitmap.h" |
| 13 #include "SkCanvas.h" | 13 #include "SkCanvas.h" |
| 14 #include "SkColor.h" | 14 #include "SkColor.h" |
| 15 #include "SkGpuDevice.h" | 15 #include "SkGpuDevice.h" |
| 16 #include "SkPaint.h" | 16 #include "SkPaint.h" |
| 17 #include "SkRect.h" | 17 #include "SkRect.h" |
| 18 #include "SkRRect.h" | 18 #include "SkRRect.h" |
| 19 #include "Test.h" | 19 #include "Test.h" |
| 20 #include "TestClassDef.h" | |
| 21 | 20 |
| 22 static void test_drawPathEmpty(skiatest::Reporter*, SkCanvas* canvas) { | 21 static void test_drawPathEmpty(skiatest::Reporter*, SkCanvas* canvas) { |
| 23 // Filling an empty path should not crash. | 22 // Filling an empty path should not crash. |
| 24 SkPaint paint; | 23 SkPaint paint; |
| 25 canvas->drawRect(SkRect(), paint); | 24 canvas->drawRect(SkRect(), paint); |
| 26 canvas->drawPath(SkPath(), paint); | 25 canvas->drawPath(SkPath(), paint); |
| 27 canvas->drawOval(SkRect(), paint); | 26 canvas->drawOval(SkRect(), paint); |
| 28 canvas->drawRect(SkRect(), paint); | 27 canvas->drawRect(SkRect(), paint); |
| 29 canvas->drawRRect(SkRRect(), paint); | 28 canvas->drawRRect(SkRRect(), paint); |
| 30 | 29 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 SkAutoTUnref<GrTexture> texture(grContext->createUncachedTexture(des
c, NULL, 0)); | 66 SkAutoTUnref<GrTexture> texture(grContext->createUncachedTexture(des
c, NULL, 0)); |
| 68 SkAutoTUnref<SkGpuDevice> device(SkNEW_ARGS(SkGpuDevice, (grContext,
texture.get()))); | 67 SkAutoTUnref<SkGpuDevice> device(SkNEW_ARGS(SkGpuDevice, (grContext,
texture.get()))); |
| 69 SkCanvas drawingCanvas(device.get()); | 68 SkCanvas drawingCanvas(device.get()); |
| 70 | 69 |
| 71 test_drawPathEmpty(reporter, &drawingCanvas); | 70 test_drawPathEmpty(reporter, &drawingCanvas); |
| 72 } | 71 } |
| 73 } | 72 } |
| 74 } | 73 } |
| 75 | 74 |
| 76 #endif | 75 #endif |
| OLD | NEW |