Fix for 2 parallel gpu rendering issues (bigbitmaprect & image-surface)
https://codereview.appspot.com/6816079/
git-svn-id: http://skia.googlecode.com/svn/trunk@6266 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gm.cpp b/gm/gm.cpp
index b6f21f8..2992b7d 100644
--- a/gm/gm.cpp
+++ b/gm/gm.cpp
@@ -40,7 +40,7 @@
}
void GM::onDrawBackground(SkCanvas* canvas) {
- canvas->drawColor(fBGColor);
+ canvas->drawColor(fBGColor, SkXfermode::kSrc_Mode);
}
void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) {
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 4a4259e..fd30c54 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -616,7 +616,7 @@
///////////////////////////////////////////////////////////////////////////////
void SkGpuDevice::clear(SkColor color) {
- fContext->clear(NULL, color, fRenderTarget);
+ fContext->clear(NULL, SkColor2GrColor(color), fRenderTarget);
fNeedClear = false;
}
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 34031f2..54c74b2 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -42,11 +42,19 @@
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() {