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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 rtKeepAlive->reset(context->textureProvider()->createTexture(desc, SkBudgete
d::kYes)); | 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 *dc != nullptr; | 65 return *dc != nullptr; |
66 } | 66 } |
67 | 67 |
68 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ClearBatch, reporter, ctxInfo) { | 68 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ClearBatch, reporter, ctxInfo) { |
69 GrContext* context = ctxInfo.fGrContext; | 69 GrContext* context = ctxInfo.fGrContext; |
70 static const int kW = 10; | 70 static const int kW = 10; |
71 static const int kH = 10; | 71 static const int kH = 10; |
72 | 72 |
73 SkIRect fullRect = SkIRect::MakeWH(kW, kH); | 73 SkIRect fullRect = SkIRect::MakeWH(kW, kH); |
74 SkAutoTUnref<GrDrawContext> drawContext; | 74 SkAutoTUnref<GrDrawContext> drawContext; |
75 SkAutoTUnref<GrSurface> rtKeepAlive; | 75 SkAutoTUnref<GrSurface> rtKeepAlive; |
76 | 76 |
77 // A rectangle that is inset by one on all sides and the 1-pixel wide rectan
gles that surround | 77 // A rectangle that is inset by one on all sides and the 1-pixel wide rectan
gles that surround |
78 // it. | 78 // it. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 228 } |
229 if (!check_rect(drawContext, outerLeftEdge, kColor1, &actualValue, &failX, &
failY) || | 229 if (!check_rect(drawContext, outerLeftEdge, kColor1, &actualValue, &failX, &
failY) || |
230 !check_rect(drawContext, outerTopEdge, kColor1, &actualValue, &failX, &f
ailY) || | 230 !check_rect(drawContext, outerTopEdge, kColor1, &actualValue, &failX, &f
ailY) || |
231 !check_rect(drawContext, outerRightEdge, kColor1, &actualValue, &failX,
&failY) || | 231 !check_rect(drawContext, outerRightEdge, kColor1, &actualValue, &failX,
&failY) || |
232 !check_rect(drawContext, outerBottomEdge, kColor1, &actualValue, &failX,
&failY)) { | 232 !check_rect(drawContext, outerBottomEdge, kColor1, &actualValue, &failX,
&failY)) { |
233 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1,
actualValue, | 233 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1,
actualValue, |
234 failX, failY); | 234 failX, failY); |
235 } | 235 } |
236 } | 236 } |
237 #endif | 237 #endif |
OLD | NEW |