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

Unified Diff: tests/GLProgramsTest.cpp

Issue 1574383002: Hide drawBatch on GrDrawTarget from test Methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 4 years, 11 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 | « src/gpu/GrTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GLProgramsTest.cpp
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index c72c31529b3a3426f9ce82aaed8ffd9cb7dde0aa..3933e649d8d6c2a9f9a6657f44fd979da3614b39 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -15,6 +15,7 @@
#include "GrAutoLocaleSetter.h"
#include "GrBatchTest.h"
#include "GrContextFactory.h"
+#include "GrDrawContext.h"
#include "GrDrawingManager.h"
#include "GrInvariantOutput.h"
#include "GrPipeline.h"
@@ -356,10 +357,13 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
set_random_state(&pipelineBuilder, &random);
set_random_stencil(&pipelineBuilder, &random);
- GrTestTarget tt;
- context->getTestTarget(&tt, rt);
+ SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt));
+ if (!drawContext) {
+ SkDebugf("Could not allocate drawContext");
+ return false;
+ }
- tt.target()->drawBatch(pipelineBuilder, batch);
+ drawContext->internal_drawBatch(pipelineBuilder, batch);
}
// Flush everything, test passes if flush is successful(ie, no asserts are hit, no crashes)
drawingManager->flush();
@@ -390,10 +394,13 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
BlockInputFragmentProcessor::Create(fp));
builder.addColorFragmentProcessor(blockFP);
- GrTestTarget tt;
- context->getTestTarget(&tt, rt);
+ SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt));
+ if (!drawContext) {
+ SkDebugf("Could not allocate a drawcontext");
+ return false;
+ }
- tt.target()->drawBatch(builder, batch);
+ drawContext->internal_drawBatch(builder, batch);
drawingManager->flush();
}
}
« no previous file with comments | « src/gpu/GrTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698