Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: tests/ClearTest.cpp

Issue 1782973002: Revert of Use std::unique_ptr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/CPlusPlusEleven.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 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 SkToBool(*dc);
66 } 66 }
67 67
68 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ClearBatch, reporter, context) { 68 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ClearBatch, reporter, context) {
69 static const int kW = 10; 69 static const int kW = 10;
70 static const int kH = 10; 70 static const int kH = 10;
71 71
72 SkIRect fullRect = SkIRect::MakeWH(kW, kH); 72 SkIRect fullRect = SkIRect::MakeWH(kW, kH);
73 SkAutoTUnref<GrDrawContext> drawContext; 73 SkAutoTUnref<GrDrawContext> drawContext;
74 SkAutoTUnref<GrSurface> rtKeepAlive; 74 SkAutoTUnref<GrSurface> rtKeepAlive;
75 75
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « tests/CPlusPlusEleven.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698