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 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 static bool reset_dc(sk_sp<GrDrawContext>* dc, GrContext* context, int w, int h)
{ | 40 static bool reset_dc(sk_sp<GrDrawContext>* dc, GrContext* context, int w, int h)
{ |
41 SkDEBUGCODE(uint32_t oldID = 0;) | 41 SkDEBUGCODE(uint32_t oldID = 0;) |
42 if (*dc) { | 42 if (*dc) { |
43 SkDEBUGCODE(oldID = (*dc)->accessRenderTarget()->getUniqueID();) | 43 SkDEBUGCODE(oldID = (*dc)->accessRenderTarget()->getUniqueID();) |
44 dc->reset(nullptr); | 44 dc->reset(nullptr); |
45 } | 45 } |
46 context->freeGpuResources(); | 46 context->freeGpuResources(); |
47 | 47 |
48 *dc = context->newDrawContext(GrContext::kTight_BackingFit, w, h, kRGBA_8888
_GrPixelConfig); | 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.fGrContext; |
57 static const int kW = 10; | 57 static const int kW = 10; |
58 static const int kH = 10; | 58 static const int kH = 10; |
(...skipping 155 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 |