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

Unified Diff: tests/PrimitiveProcessorTest.cpp

Issue 1914883002: Refactor drawContext/RenderTarget creation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix variable name Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/ClipBoundsTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PrimitiveProcessorTest.cpp
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index 6d4ede1ce9246e725daaa718452c35b70a33af4e..b1157a33a9e3c24aec044338d8b7ec5260e8a8d1 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -103,18 +103,9 @@ private:
DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) {
GrContext* context = ctxInfo.fGrContext;
- GrTextureDesc desc;
- desc.fHeight = 1;
- desc.fWidth = 1;
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fConfig = kRGBA_8888_GrPixelConfig;
- SkAutoTUnref<GrTexture> target(context->textureProvider()->createTexture(desc,
- SkBudgeted::kYes));
- if (!target) {
- ERRORF(reporter, "Could not create render target.");
- return;
- }
- sk_sp<GrDrawContext> dc(context->drawContext(sk_ref_sp(target->asRenderTarget())));
+
+ sk_sp<GrDrawContext> dc(context->newDrawContext(GrContext::kLoose_BackingFit,
+ 1, 1, kRGBA_8888_GrPixelConfig));
if (!dc) {
ERRORF(reporter, "Could not create draw context.");
return;
@@ -132,7 +123,7 @@ DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) {
#endif
SkAutoTUnref<GrDrawBatch> batch;
GrPipelineBuilder pb;
- pb.setRenderTarget(target->asRenderTarget());
+ pb.setRenderTarget(dc->accessRenderTarget());
// This one should succeed.
batch.reset(new Batch(attribCnt));
dc->drawContextPriv().testingOnly_drawBatch(pb, batch);
« no previous file with comments | « tests/ClipBoundsTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698