OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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" | 8 #include "Test.h" |
9 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 context->freeGpuResources(); | 46 context->freeGpuResources(); |
47 | 47 |
48 *dc = context->newDrawContext(SkBackingFit::kExact, w, h, kRGBA_8888_GrPixel
Config); | 48 *dc = context->newDrawContext(SkBackingFit::kExact, w, h, kRGBA_8888_GrPixel
Config); |
49 | 49 |
50 SkASSERT((*dc)->accessRenderTarget()->getUniqueID() != oldID); | 50 SkASSERT((*dc)->accessRenderTarget()->getUniqueID() != oldID); |
51 | 51 |
52 return *dc != nullptr; | 52 return *dc != nullptr; |
53 } | 53 } |
54 | 54 |
55 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ClearBatch, reporter, ctxInfo) { | 55 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ClearBatch, reporter, ctxInfo) { |
56 GrContext* context = ctxInfo.fGrContext; | 56 GrContext* context = ctxInfo.grContext(); |
57 static const int kW = 10; | 57 static const int kW = 10; |
58 static const int kH = 10; | 58 static const int kH = 10; |
59 | 59 |
60 SkIRect fullRect = SkIRect::MakeWH(kW, kH); | 60 SkIRect fullRect = SkIRect::MakeWH(kW, kH); |
61 sk_sp<GrDrawContext> drawContext; | 61 sk_sp<GrDrawContext> drawContext; |
62 | 62 |
63 // A rectangle that is inset by one on all sides and the 1-pixel wide rectan
gles that surround | 63 // A rectangle that is inset by one on all sides and the 1-pixel wide rectan
gles that surround |
64 // it. | 64 // it. |
65 SkIRect mid1Rect = SkIRect::MakeXYWH(1, 1, kW-2, kH-2); | 65 SkIRect mid1Rect = SkIRect::MakeXYWH(1, 1, kW-2, kH-2); |
66 SkIRect outerLeftEdge = SkIRect::MakeXYWH(0, 0, 1, kH); | 66 SkIRect outerLeftEdge = SkIRect::MakeXYWH(0, 0, 1, kH); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 } | 214 } |
215 if (!check_rect(drawContext.get(), outerLeftEdge, kColor1, &actualValue, &fa
ilX, &failY) || | 215 if (!check_rect(drawContext.get(), outerLeftEdge, kColor1, &actualValue, &fa
ilX, &failY) || |
216 !check_rect(drawContext.get(), outerTopEdge, kColor1, &actualValue, &fai
lX, &failY) || | 216 !check_rect(drawContext.get(), outerTopEdge, kColor1, &actualValue, &fai
lX, &failY) || |
217 !check_rect(drawContext.get(), outerRightEdge, kColor1, &actualValue, &f
ailX, &failY) || | 217 !check_rect(drawContext.get(), outerRightEdge, kColor1, &actualValue, &f
ailX, &failY) || |
218 !check_rect(drawContext.get(), outerBottomEdge, kColor1, &actualValue, &
failX, &failY)) { | 218 !check_rect(drawContext.get(), outerBottomEdge, kColor1, &actualValue, &
failX, &failY)) { |
219 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1,
actualValue, | 219 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1,
actualValue, |
220 failX, failY); | 220 failX, failY); |
221 } | 221 } |
222 } | 222 } |
223 #endif | 223 #endif |
OLD | NEW |