aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-02 17:38:28 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-02 17:38:28 +0000
commitea5d8af9fb20096f350d2f313935ba37a592c160 (patch)
treef8f05a9802009a4cc71af88bd6e43f9150a6976a
parentee5ea6b8e0ba8a6cd4581c941cc732864c7ad00c (diff)
Fix for 2 parallel gpu rendering issues (bigbitmaprect & image-surface)
-rw-r--r--gm/gm.cpp2
-rw-r--r--src/gpu/SkGpuDevice.cpp2
-rw-r--r--src/image/SkSurface_Gpu.cpp8
3 files changed, 10 insertions, 2 deletions
diff --git a/gm/gm.cpp b/gm/gm.cpp
index b6f21f81ff..2992b7df40 100644
--- a/gm/gm.cpp
+++ b/gm/gm.cpp
@@ -40,7 +40,7 @@ void GM::setBGColor(SkColor color) {
}
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 4a4259ef53..fd30c54a0f 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -616,7 +616,7 @@ inline bool skPaint2GrPaintShader(SkGpuDevice* dev,
///////////////////////////////////////////////////////////////////////////////
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 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() {