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

Side by Side Diff: tests/ClearTest.cpp

Issue 1937553002: Add Gr*Proxy classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix memory bugs Created 4 years, 7 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 | « src/image/SkImage_Gpu.cpp ('k') | tests/PrimitiveProcessorTest.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 27 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | tests/PrimitiveProcessorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698