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

Side by Side Diff: tests/PrimitiveProcessorTest.cpp

Issue 2186073002: Rename GrContext's newDrawContext & drawContext to makeDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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/GLProgramsTest.cpp ('k') | tests/RectangleTextureTest.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 // This is a GPU-backend specific test. It relies on static intializers to work 8 // This is a GPU-backend specific test. It relies on static intializers to work
9 9
10 #include "SkTypes.h" 10 #include "SkTypes.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 int fNumAttribs; 98 int fNumAttribs;
99 99
100 typedef GrVertexBatch INHERITED; 100 typedef GrVertexBatch INHERITED;
101 }; 101 };
102 } 102 }
103 103
104 DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { 104 DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) {
105 GrContext* context = ctxInfo.grContext(); 105 GrContext* context = ctxInfo.grContext();
106 106
107 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr ox, 107 sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApp rox,
108 1, 1, kRGBA_8888_Gr PixelConfig, 108 1, 1, kRGBA_8888_G rPixelConfig,
109 nullptr)); 109 nullptr));
110 if (!drawContext) { 110 if (!drawContext) {
111 ERRORF(reporter, "Could not create draw context."); 111 ERRORF(reporter, "Could not create draw context.");
112 return; 112 return;
113 } 113 }
114 int attribCnt = context->caps()->maxVertexAttributes(); 114 int attribCnt = context->caps()->maxVertexAttributes();
115 if (!attribCnt) { 115 if (!attribCnt) {
116 ERRORF(reporter, "No attributes allowed?!"); 116 ERRORF(reporter, "No attributes allowed?!");
117 return; 117 return;
118 } 118 }
119 context->flush(); 119 context->flush();
(...skipping 16 matching lines...) Expand all
136 // This one should fail. 136 // This one should fail.
137 batch.reset(new Batch(attribCnt+1)); 137 batch.reset(new Batch(attribCnt+1));
138 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch); 138 drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch);
139 context->flush(); 139 context->flush();
140 #if GR_GPU_STATS 140 #if GR_GPU_STATS
141 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0); 141 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0);
142 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1) ; 142 REPORTER_ASSERT(reporter, context->getGpu()->stats()->numFailedDraws() == 1) ;
143 #endif 143 #endif
144 } 144 }
145 #endif 145 #endif
OLDNEW
« no previous file with comments | « tests/GLProgramsTest.cpp ('k') | tests/RectangleTextureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698