| 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 #include "SkDevice.h" | 9 #include "SkDevice.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 fPicture->flatten(buffer); | 77 fPicture->flatten(buffer); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 buffer.writeRect(fCropRect); | 80 buffer.writeRect(fCropRect); |
| 81 buffer.writeInt(fPictureResolution); | 81 buffer.writeInt(fPictureResolution); |
| 82 if (kLocalSpace_PictureResolution == fPictureResolution) { | 82 if (kLocalSpace_PictureResolution == fPictureResolution) { |
| 83 buffer.writeInt(fFilterQuality); | 83 buffer.writeInt(fFilterQuality); |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool SkPictureImageFilter::onFilterImage(Proxy* proxy, const SkBitmap&, const Co
ntext& ctx, | 87 bool SkPictureImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap&
, |
| 88 SkBitmap* result, SkIPoint* offset) con
st { | 88 const Context& ctx, |
| 89 SkBitmap* result, SkIPoint* o
ffset) const { |
| 89 if (!fPicture) { | 90 if (!fPicture) { |
| 90 offset->fX = offset->fY = 0; | 91 offset->fX = offset->fY = 0; |
| 91 return true; | 92 return true; |
| 92 } | 93 } |
| 93 | 94 |
| 94 SkRect floatBounds; | 95 SkRect floatBounds; |
| 95 ctx.ctm().mapRect(&floatBounds, fCropRect); | 96 ctx.ctm().mapRect(&floatBounds, fCropRect); |
| 96 SkIRect bounds = floatBounds.roundOut(); | 97 SkIRect bounds = floatBounds.roundOut(); |
| 97 if (!bounds.intersect(ctx.clipBounds())) { | 98 if (!bounds.intersect(ctx.clipBounds())) { |
| 98 return false; | 99 return false; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 str->appendf("crop: (%f,%f,%f,%f) ", | 168 str->appendf("crop: (%f,%f,%f,%f) ", |
| 168 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB
ottom); | 169 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB
ottom); |
| 169 if (fPicture) { | 170 if (fPicture) { |
| 170 str->appendf("picture: (%f,%f,%f,%f)", | 171 str->appendf("picture: (%f,%f,%f,%f)", |
| 171 fPicture->cullRect().fLeft, fPicture->cullRect().fTop, | 172 fPicture->cullRect().fLeft, fPicture->cullRect().fTop, |
| 172 fPicture->cullRect().fRight, fPicture->cullRect().fBottom); | 173 fPicture->cullRect().fRight, fPicture->cullRect().fBottom); |
| 173 } | 174 } |
| 174 str->append(")"); | 175 str->append(")"); |
| 175 } | 176 } |
| 176 #endif | 177 #endif |
| OLD | NEW |