| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |