Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: src/effects/SkPictureImageFilter.cpp

Issue 1969193002: SkPictureImageFilter - clear local canvas before use (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The Android Open Source Project 2 * Copyright 2013 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPictureImageFilter.h" 8 #include "SkPictureImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 const SkImageInfo info = SkImageInfo::MakeN32(localIBounds.width(), loca lIBounds.height(), 170 const SkImageInfo info = SkImageInfo::MakeN32(localIBounds.width(), loca lIBounds.height(),
171 kPremul_SkAlphaType); 171 kPremul_SkAlphaType);
172 172
173 sk_sp<SkSpecialSurface> localSurface(source->makeSurface(info)); 173 sk_sp<SkSpecialSurface> localSurface(source->makeSurface(info));
174 if (!localSurface) { 174 if (!localSurface) {
175 return; 175 return;
176 } 176 }
177 177
178 SkCanvas* localCanvas = localSurface->getCanvas(); 178 SkCanvas* localCanvas = localSurface->getCanvas();
179 SkASSERT(localCanvas); 179 SkASSERT(localCanvas);
180
181 localCanvas->clear(0x0);
180 182
181 localCanvas->translate(-SkIntToScalar(localIBounds.fLeft), 183 localCanvas->translate(-SkIntToScalar(localIBounds.fLeft),
182 -SkIntToScalar(localIBounds.fTop)); 184 -SkIntToScalar(localIBounds.fTop));
183 localCanvas->drawPicture(fPicture); 185 localCanvas->drawPicture(fPicture);
184 186
185 localImg = localSurface->makeImageSnapshot(); 187 localImg = localSurface->makeImageSnapshot();
186 SkASSERT(localImg); 188 SkASSERT(localImg);
187 } 189 }
188 190
189 { 191 {
(...skipping 15 matching lines...) Expand all
205 str->appendf("crop: (%f,%f,%f,%f) ", 207 str->appendf("crop: (%f,%f,%f,%f) ",
206 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB ottom); 208 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB ottom);
207 if (fPicture) { 209 if (fPicture) {
208 str->appendf("picture: (%f,%f,%f,%f)", 210 str->appendf("picture: (%f,%f,%f,%f)",
209 fPicture->cullRect().fLeft, fPicture->cullRect().fTop, 211 fPicture->cullRect().fLeft, fPicture->cullRect().fTop,
210 fPicture->cullRect().fRight, fPicture->cullRect().fBottom); 212 fPicture->cullRect().fRight, fPicture->cullRect().fBottom);
211 } 213 }
212 str->append(")"); 214 str->append(")");
213 } 215 }
214 #endif 216 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698