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

Unified Diff: tests/GLProgramsTest.cpp

Issue 2165683002: Simplify random_draw_context used by GLProgramsTest (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | 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 171ed613163a2993a113cebc5dc3e2839e100f44..16a259207852daa8cb4e8035a132d299d8f993cd 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -154,33 +154,12 @@ static sk_sp<GrDrawContext> random_draw_context(GrContext* context,
: kBottomLeft_GrSurfaceOrigin;
int sampleCnt = random->nextBool() ? SkTMin(4, caps->maxSampleCount()) : 0;
- GrUniqueKey key;
bsalomon 2016/07/19 15:04:29 I presume this keying was preserved from pre-DC da
- static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
- GrUniqueKey::Builder builder(&key, kDomain, 2);
- builder[0] = origin;
- builder[1] = sampleCnt;
- builder.finish();
-
- sk_sp<GrTexture> texture(context->textureProvider()->findAndRefTextureByUniqueKey(key));
- if (texture) {
- sk_sp<GrRenderTarget> rt(sk_ref_sp(texture->asRenderTarget()));
- return context->drawContext(std::move(rt));
- }
-
sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kExact,
kRenderTargetWidth,
kRenderTargetHeight,
kRGBA_8888_GrPixelConfig,
sampleCnt,
origin));
- if (!drawContext) {
- return nullptr;
- }
-
- // TODO: need a real way to do this via the drawContext
- texture = drawContext->asTexture();
- context->textureProvider()->assignUniqueKeyToTexture(key, texture.get());
-
return drawContext;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698