diff options
| author | joshualitt <joshualitt@chromium.org> | 2016-01-13 07:47:38 -0800 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2016-01-13 07:47:38 -0800 |
| commit | f5883a6d75a18c581507214d3057b5c721ed1ffc (patch) | |
| tree | f9921193781c157919a5defe0de531ddb36b3c2e /tests/GLProgramsTest.cpp | |
| parent | bc90735170b5d85a19b24df0baa865f7cf87d348 (diff) | |
Hide drawBatch on GrDrawTarget from test Methods
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574383002
Review URL: https://codereview.chromium.org/1574383002
Diffstat (limited to 'tests/GLProgramsTest.cpp')
| -rw-r--r-- | tests/GLProgramsTest.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index c72c31529b..3933e649d8 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(); } } |
