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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 23707019: alpha threshold bitmap shader (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: false->NULL Created 7 years, 3 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/effects/SkBitmapAlphaThresholdShader.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 571b8a0a7d91206159ec71fcddbafb65c1581cbd..ea8a06e632683e7f0ebb75dad23d3b48efa24425 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -535,6 +535,11 @@ inline bool skPaint2GrPaintShader(SkGpuDevice* dev,
return skPaint2GrPaintNoShader(dev, skPaint, false, constantColor, grPaint);
}
+ // SkShader::asNewEffect() may do offscreen rendering. Setup default drawing state
+ // Also require shader to set the render target .
+ GrContext::AutoWideOpenIdentityDraw awo(dev->context(), NULL);
+ GrContext::AutoRenderTarget(dev->context(), NULL);
+
// setup the shader as the first color effect on the paint
SkAutoTUnref<GrEffectRef> effect(shader->asNewEffect(dev->context(), skPaint));
if (NULL != effect.get()) {
« no previous file with comments | « src/effects/SkBitmapAlphaThresholdShader.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698