| 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" |
| 11 #include "SkReadBuffer.h" | 11 #include "SkReadBuffer.h" |
| 12 #include "SkWriteBuffer.h" | 12 #include "SkWriteBuffer.h" |
| 13 #include "SkValidationUtils.h" | 13 #include "SkValidationUtils.h" |
| 14 | 14 |
| 15 SkPictureImageFilter::SkPictureImageFilter(SkPicture* picture) | 15 SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture) |
| 16 : INHERITED(0, 0), | 16 : INHERITED(0, 0), |
| 17 fPicture(picture), | 17 fPicture(picture), |
| 18 fCropRect(SkRect::MakeWH(picture ? SkIntToScalar(picture->width()) : 0, | 18 fCropRect(SkRect::MakeWH(picture ? SkIntToScalar(picture->width()) : 0, |
| 19 picture ? SkIntToScalar(picture->height()) : 0)) { | 19 picture ? SkIntToScalar(picture->height()) : 0)) { |
| 20 SkSafeRef(fPicture); | 20 SkSafeRef(fPicture); |
| 21 } | 21 } |
| 22 | 22 |
| 23 SkPictureImageFilter::SkPictureImageFilter(SkPicture* picture, const SkRect& cro
pRect) | 23 SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture, const SkRec
t& cropRect) |
| 24 : INHERITED(0, 0), | 24 : INHERITED(0, 0), |
| 25 fPicture(picture), | 25 fPicture(picture), |
| 26 fCropRect(cropRect) { | 26 fCropRect(cropRect) { |
| 27 SkSafeRef(fPicture); | 27 SkSafeRef(fPicture); |
| 28 } | 28 } |
| 29 | 29 |
| 30 SkPictureImageFilter::~SkPictureImageFilter() { | 30 SkPictureImageFilter::~SkPictureImageFilter() { |
| 31 SkSafeUnref(fPicture); | 31 SkSafeUnref(fPicture); |
| 32 } | 32 } |
| 33 | 33 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 offset->fY = bounds.fTop; | 92 offset->fY = bounds.fTop; |
| 93 return true; | 93 return true; |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool SkPictureImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ct
m, | 96 bool SkPictureImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ct
m, |
| 97 SkIRect* dst) const { | 97 SkIRect* dst) const { |
| 98 *dst = src; | 98 *dst = src; |
| 99 return true; | 99 return true; |
| 100 } | 100 } |
| 101 | 101 |
| OLD | NEW |