aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-07-27 12:13:51 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-27 12:13:51 -0700
commit6738c702423226619ee0172c12a3a007c5f68e57 (patch)
tree96d7941308e92731354cd8e4ef21ecfc900ca7cd /tests
parent81ce4a9c551f5ecbd549b992b1f1e7689049c615 (diff)
Rename GrContext's newDrawContext & drawContext to makeDrawContext
Diffstat (limited to 'tests')
-rw-r--r--tests/ClearTest.cpp2
-rw-r--r--tests/DFPathRendererTest.cpp18
-rw-r--r--tests/GLProgramsTest.cpp24
-rw-r--r--tests/PrimitiveProcessorTest.cpp6
-rw-r--r--tests/RectangleTextureTest.cpp4
-rw-r--r--tests/SRGBMipMapTest.cpp12
-rw-r--r--tests/TessellatingPathRendererTests.cpp48
7 files changed, 57 insertions, 57 deletions
diff --git a/tests/ClearTest.cpp b/tests/ClearTest.cpp
index 4afbabaa56..4dba4bbb95 100644
--- a/tests/ClearTest.cpp
+++ b/tests/ClearTest.cpp
@@ -45,7 +45,7 @@ static bool reset_dc(sk_sp<GrDrawContext>* dc, GrContext* context, int w, int h)
}
context->freeGpuResources();
- *dc = context->newDrawContext(SkBackingFit::kExact, w, h, kRGBA_8888_GrPixelConfig, nullptr);
+ *dc = context->makeDrawContext(SkBackingFit::kExact, w, h, kRGBA_8888_GrPixelConfig, nullptr);
SkASSERT((*dc)->accessRenderTarget()->getUniqueID() != oldID);
diff --git a/tests/DFPathRendererTest.cpp b/tests/DFPathRendererTest.cpp
index e1af6acd93..d36c16845e 100644
--- a/tests/DFPathRendererTest.cpp
+++ b/tests/DFPathRendererTest.cpp
@@ -63,22 +63,22 @@ DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(AADistanceFieldPathRenderer, reporter, ctxInfo)
if (!ctxInfo.grContext()->caps()->shaderCaps()->shaderDerivativeSupport()) {
return;
}
- sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBackingFit::kApprox,
- 800, 800,
- kSkia8888_GrPixelConfig,
- nullptr,
- 0,
- kTopLeft_GrSurfaceOrigin));
- if (!drawContext) {
+ sk_sp<GrDrawContext> dc(ctxInfo.grContext()->makeDrawContext(SkBackingFit::kApprox,
+ 800, 800,
+ kSkia8888_GrPixelConfig,
+ nullptr,
+ 0,
+ kTopLeft_GrSurfaceOrigin));
+ if (!dc) {
return;
}
GrAADistanceFieldPathRenderer dfpr;
GrTestTarget tt;
- ctxInfo.grContext()->getTestTarget(&tt, drawContext);
+ ctxInfo.grContext()->getTestTarget(&tt, dc);
GrResourceProvider* rp = tt.resourceProvider();
- test_far_from_origin(drawContext.get(), &dfpr, rp);
+ test_far_from_origin(dc.get(), &dfpr, rp);
ctxInfo.grContext()->flush();
}
#endif
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 393de53b74..2d62a5b3c3 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -154,13 +154,13 @@ static sk_sp<GrDrawContext> random_draw_context(GrContext* context,
: kBottomLeft_GrSurfaceOrigin;
int sampleCnt = random->nextBool() ? SkTMin(4, caps->maxSampleCount()) : 0;
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kExact,
- kRenderTargetWidth,
- kRenderTargetHeight,
- kRGBA_8888_GrPixelConfig,
- nullptr,
- sampleCnt,
- origin));
+ sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kExact,
+ kRenderTargetWidth,
+ kRenderTargetHeight,
+ kRGBA_8888_GrPixelConfig,
+ nullptr,
+ sampleCnt,
+ origin));
return drawContext;
}
@@ -343,11 +343,11 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
drawingManager->flush();
// Validate that GrFPs work correctly without an input.
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kExact,
- kRenderTargetWidth,
- kRenderTargetHeight,
- kRGBA_8888_GrPixelConfig,
- nullptr));
+ sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kExact,
+ kRenderTargetWidth,
+ kRenderTargetHeight,
+ kRGBA_8888_GrPixelConfig,
+ nullptr));
if (!drawContext) {
SkDebugf("Could not allocate a drawContext");
return false;
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index acaf9e98af..7a080c57ac 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -104,9 +104,9 @@ private:
DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
- sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kApprox,
- 1, 1, kRGBA_8888_GrPixelConfig,
- nullptr));
+ sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApprox,
+ 1, 1, kRGBA_8888_GrPixelConfig,
+ nullptr));
if (!drawContext) {
ERRORF(reporter, "Could not create draw context.");
return;
diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp
index b42b3bac6c..2dbb888425 100644
--- a/tests/RectangleTextureTest.cpp
+++ b/tests/RectangleTextureTest.cpp
@@ -90,8 +90,8 @@ static void test_clear(skiatest::Reporter* reporter, GrContext* context,
GrTexture* rectangleTexture) {
if (rectangleTexture->asRenderTarget()) {
sk_sp<GrDrawContext> dc(
- context->drawContext(sk_ref_sp(rectangleTexture->asRenderTarget()),
- nullptr));
+ context->makeDrawContext(sk_ref_sp(rectangleTexture->asRenderTarget()),
+ nullptr));
if (!dc) {
ERRORF(reporter, "Could not get GrDrawContext for rectangle texture.");
return;
diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp
index 12f23adbbf..6eb4b2114a 100644
--- a/tests/SRGBMipMapTest.cpp
+++ b/tests/SRGBMipMapTest.cpp
@@ -121,12 +121,12 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) {
// Create two draw contexts (L32 and S32)
sk_sp<SkColorSpace> srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
- sk_sp<GrDrawContext> l32DrawContext = context->newDrawContext(SkBackingFit::kExact, rtS, rtS,
- kSkia8888_GrPixelConfig,
- nullptr);
- sk_sp<GrDrawContext> s32DrawContext = context->newDrawContext(SkBackingFit::kExact, rtS, rtS,
- kSkiaGamma8888_GrPixelConfig,
- std::move(srgbColorSpace));
+ sk_sp<GrDrawContext> l32DrawContext = context->makeDrawContext(SkBackingFit::kExact, rtS, rtS,
+ kSkia8888_GrPixelConfig,
+ nullptr);
+ sk_sp<GrDrawContext> s32DrawContext = context->makeDrawContext(SkBackingFit::kExact, rtS, rtS,
+ kSkiaGamma8888_GrPixelConfig,
+ std::move(srgbColorSpace));
SkRect rect = SkRect::MakeWH(SkIntToScalar(rtS), SkIntToScalar(rtS));
GrNoClip noClip;
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index 5e8d952f32..d9afcc4d3d 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -254,35 +254,35 @@ static void test_path(GrDrawContext* drawContext, GrResourceProvider* rp, const
}
DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
- sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBackingFit::kApprox,
- 800, 800,
- kSkia8888_GrPixelConfig,
- nullptr,
- 0,
- kTopLeft_GrSurfaceOrigin));
- if (!drawContext) {
+ sk_sp<GrDrawContext> dc(ctxInfo.grContext()->makeDrawContext(SkBackingFit::kApprox,
+ 800, 800,
+ kSkia8888_GrPixelConfig,
+ nullptr,
+ 0,
+ kTopLeft_GrSurfaceOrigin));
+ if (!dc) {
return;
}
GrTestTarget tt;
- ctxInfo.grContext()->getTestTarget(&tt, drawContext);
+ ctxInfo.grContext()->getTestTarget(&tt, dc);
GrResourceProvider* rp = tt.resourceProvider();
- test_path(drawContext.get(), rp, create_path_0());
- test_path(drawContext.get(), rp, create_path_1());
- test_path(drawContext.get(), rp, create_path_2());
- test_path(drawContext.get(), rp, create_path_3());
- test_path(drawContext.get(), rp, create_path_4());
- test_path(drawContext.get(), rp, create_path_5());
- test_path(drawContext.get(), rp, create_path_6());
- test_path(drawContext.get(), rp, create_path_7());
- test_path(drawContext.get(), rp, create_path_8());
- test_path(drawContext.get(), rp, create_path_9());
- test_path(drawContext.get(), rp, create_path_10());
- test_path(drawContext.get(), rp, create_path_11());
- test_path(drawContext.get(), rp, create_path_12());
- test_path(drawContext.get(), rp, create_path_13());
- test_path(drawContext.get(), rp, create_path_14());
- test_path(drawContext.get(), rp, create_path_15());
+ test_path(dc.get(), rp, create_path_0());
+ test_path(dc.get(), rp, create_path_1());
+ test_path(dc.get(), rp, create_path_2());
+ test_path(dc.get(), rp, create_path_3());
+ test_path(dc.get(), rp, create_path_4());
+ test_path(dc.get(), rp, create_path_5());
+ test_path(dc.get(), rp, create_path_6());
+ test_path(dc.get(), rp, create_path_7());
+ test_path(dc.get(), rp, create_path_8());
+ test_path(dc.get(), rp, create_path_9());
+ test_path(dc.get(), rp, create_path_10());
+ test_path(dc.get(), rp, create_path_11());
+ test_path(dc.get(), rp, create_path_12());
+ test_path(dc.get(), rp, create_path_13());
+ test_path(dc.get(), rp, create_path_14());
+ test_path(dc.get(), rp, create_path_15());
}
#endif