aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkSurface_Gpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/image/SkSurface_Gpu.cpp')
-rw-r--r--src/image/SkSurface_Gpu.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 34031f2301..54c74b2bab 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -42,11 +42,19 @@ SkSurface_Gpu::SkSurface_Gpu(GrContext* ctx, const SkImage::Info& info,
SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
fDevice = SkNEW_ARGS(SkGpuDevice, (ctx, config, info.fWidth, info.fHeight, sampleCount));
+
+ if (!isOpaque) {
+ fDevice->clear(0x0);
+ }
}
SkSurface_Gpu::SkSurface_Gpu(GrContext* ctx, GrRenderTarget* renderTarget)
: INHERITED(renderTarget->width(), renderTarget->height()) {
fDevice = SkNEW_ARGS(SkGpuDevice, (ctx, renderTarget));
+
+ if (kRGB_565_GrPixelConfig != renderTarget->config()) {
+ fDevice->clear(0x0);
+ }
}
SkSurface_Gpu::~SkSurface_Gpu() {