diff options
author | 2012-11-02 17:38:28 +0000 | |
---|---|---|
committer | 2012-11-02 17:38:28 +0000 | |
commit | ea5d8af9fb20096f350d2f313935ba37a592c160 (patch) | |
tree | f8f05a9802009a4cc71af88bd6e43f9150a6976a | |
parent | ee5ea6b8e0ba8a6cd4581c941cc732864c7ad00c (diff) |
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
-rw-r--r-- | gm/gm.cpp | 2 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 2 | ||||
-rw-r--r-- | src/image/SkSurface_Gpu.cpp | 8 |
3 files changed, 10 insertions, 2 deletions
@@ -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() { |