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

Unified Diff: tests/GLProgramsTest.cpp

Issue 1137333004: fix for angle bot (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/GrAtlasTextContext.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 1061f3c589afe590744a19f84142a1d72254d9ef..7f1f4ec946acd4a62a796e842a1277d7bce22f24 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -105,7 +105,8 @@ GrFragmentProcessor* BigKeyProcessor::TestCreate(SkRandom*,
static const int kRenderTargetHeight = 1;
static const int kRenderTargetWidth = 1;
-static GrRenderTarget* random_render_target(GrContext* context, SkRandom* random) {
+static GrRenderTarget* random_render_target(GrContext* context, SkRandom* random,
+ const GrDrawTargetCaps* caps) {
// setup render target
GrTextureParams params;
GrSurfaceDesc texDesc;
@@ -115,7 +116,7 @@ static GrRenderTarget* random_render_target(GrContext* context, SkRandom* random
texDesc.fConfig = kRGBA_8888_GrPixelConfig;
texDesc.fOrigin = random->nextBool() == true ? kTopLeft_GrSurfaceOrigin :
kBottomLeft_GrSurfaceOrigin;
- texDesc.fSampleCnt = random->nextBool() == true ? 4 : 0;
+ texDesc.fSampleCnt = random->nextBool() == true ? SkTMin(4, caps->maxSampleCount()) : 0;
GrUniqueKey key;
static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
@@ -239,7 +240,7 @@ bool GrDrawTarget::programUnitTest(int maxStages) {
static const int NUM_TESTS = 2048;
for (int t = 0; t < NUM_TESTS; t++) {
// setup random render target(can fail)
- SkAutoTUnref<GrRenderTarget> rt(random_render_target(fContext, &random));
+ SkAutoTUnref<GrRenderTarget> rt(random_render_target(fContext, &random, this->caps()));
if (!rt.get()) {
SkDebugf("Could not allocate render target");
return false;
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698