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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 dc->reset(nullptr); | 48 dc->reset(nullptr); |
49 } | 49 } |
50 context->freeGpuResources(); | 50 context->freeGpuResources(); |
51 | 51 |
52 GrTextureDesc desc; | 52 GrTextureDesc desc; |
53 desc.fWidth = w; | 53 desc.fWidth = w; |
54 desc.fHeight = h; | 54 desc.fHeight = h; |
55 desc.fConfig = kRGBA_8888_GrPixelConfig; | 55 desc.fConfig = kRGBA_8888_GrPixelConfig; |
56 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 56 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
57 | 57 |
58 rtKeepAlive->reset(context->textureProvider()->createTexture(desc, true)); | 58 rtKeepAlive->reset(context->textureProvider()->createTexture(desc, SkBudgete
d::kYes)); |
59 if (!(*rtKeepAlive)) { | 59 if (!(*rtKeepAlive)) { |
60 return false; | 60 return false; |
61 } | 61 } |
62 GrRenderTarget* rt = (*rtKeepAlive)->asRenderTarget(); | 62 GrRenderTarget* rt = (*rtKeepAlive)->asRenderTarget(); |
63 SkASSERT(rt->getUniqueID() != oldID); | 63 SkASSERT(rt->getUniqueID() != oldID); |
64 dc->reset(context->drawContext(rt)); | 64 dc->reset(context->drawContext(rt)); |
65 return SkToBool(*dc); | 65 return SkToBool(*dc); |
66 } | 66 } |
67 | 67 |
68 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ClearBatch, reporter, context) { | 68 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ClearBatch, reporter, context) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 227 } |
228 if (!check_rect(drawContext, outerLeftEdge, kColor1, &actualValue, &failX, &
failY) || | 228 if (!check_rect(drawContext, outerLeftEdge, kColor1, &actualValue, &failX, &
failY) || |
229 !check_rect(drawContext, outerTopEdge, kColor1, &actualValue, &failX, &f
ailY) || | 229 !check_rect(drawContext, outerTopEdge, kColor1, &actualValue, &failX, &f
ailY) || |
230 !check_rect(drawContext, outerRightEdge, kColor1, &actualValue, &failX,
&failY) || | 230 !check_rect(drawContext, outerRightEdge, kColor1, &actualValue, &failX,
&failY) || |
231 !check_rect(drawContext, outerBottomEdge, kColor1, &actualValue, &failX,
&failY)) { | 231 !check_rect(drawContext, outerBottomEdge, kColor1, &actualValue, &failX,
&failY)) { |
232 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1,
actualValue, | 232 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1,
actualValue, |
233 failX, failY); | 233 failX, failY); |
234 } | 234 } |
235 } | 235 } |
236 #endif | 236 #endif |
OLD | NEW |