From 1573206f202c6d2ffcffab78b17160da95a80466 Mon Sep 17 00:00:00 2001 From: joshualitt Date: Wed, 13 May 2015 12:15:14 -0700 Subject: [PATCH] fix for angle bot TBR= BUG=skia: Review URL: https://codereview.chromium.org/1137333004 --- src/gpu/GrAtlasTextContext.cpp | 2 +- tests/GLProgramsTest.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp index 22436f7c12..8f4e78fd06 100644 --- a/src/gpu/GrAtlasTextContext.cpp +++ b/src/gpu/GrAtlasTextContext.cpp @@ -2245,7 +2245,7 @@ BATCH_TEST_DEFINE(TextBlobBatch) { desc.fWidth = 1024; desc.fHeight = 1024; desc.fConfig = kRGBA_8888_GrPixelConfig; - desc.fSampleCnt = 1; + desc.fSampleCnt = 0; SkAutoTUnref texture(context->textureProvider()->createTexture(desc, true, NULL, 0)); SkASSERT(texture); SkASSERT(NULL != texture->asRenderTarget()); diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 1061f3c589..7f1f4ec946 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 rt(random_render_target(fContext, &random)); + SkAutoTUnref rt(random_render_target(fContext, &random, this->caps())); if (!rt.get()) { SkDebugf("Could not allocate render target"); return false;