diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-10 15:48:16 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-10 15:48:16 +0000 |
commit | 0197b32bfb98c793c8104cefde26ca62562d1f0e (patch) | |
tree | dd5fd1025c663cec41ee61b2785ff6c6078dc56a /src | |
parent | 96b128b760c39e2748ed1c90b0bfad08af5ab606 (diff) |
Always clear dest in SkBitmap::copyTo's draw path
https://codereview.chromium.org/26268003/
git-svn-id: http://skia.googlecode.com/svn/trunk@11697 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBitmap.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 1d1cc0a45d..434c817e52 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -1119,10 +1119,9 @@ bool SkBitmap::copyTo(SkBitmap* dst, Config dstConfig, Allocator* alloc) const { } } } else { - // if the src has alpha, we have to clear the dst first - if (!src->isOpaque()) { - tmpDst.eraseColor(SK_ColorTRANSPARENT); - } + // Always clear the dest in case one of the blitters accesses it + // TODO: switch the allocation of tmpDst to call sk_calloc_throw + tmpDst.eraseColor(SK_ColorTRANSPARENT); SkCanvas canvas(tmpDst); SkPaint paint; |