Updated blur to use A8/R8 (instead of RGBA8) when available - this provides a performance gain for large blurs
http://codereview.appspot.com/5988071/
git-svn-id: http://skia.googlecode.com/svn/trunk@3647 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index cf05284..bb088b2 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -788,16 +788,20 @@
}
GrPoint offset = GrPoint::Make(-srcRect.fLeft, -srcRect.fTop);
srcRect.offset(offset);
- const GrTextureDesc desc = {
+ GrTextureDesc desc = {
kRenderTarget_GrTextureFlagBit,
SkScalarCeilToInt(srcRect.width()),
SkScalarCeilToInt(srcRect.height()),
// We actually only need A8, but it often isn't supported as a
- // render target
+ // render target so default to RGBA_8888
kRGBA_8888_PM_GrPixelConfig,
0 // samples
};
+ if (context->isConfigRenderable(kAlpha_8_GrPixelConfig)) {
+ desc.fConfig = kAlpha_8_GrPixelConfig;
+ }
+
GrAutoScratchTexture pathEntry(context, desc);
GrTexture* pathTexture = pathEntry.texture();
if (NULL == pathTexture) {