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

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

Issue 390023002: Make SkPictureShader and SkPictureImageFilter use const SkPictures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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 | « src/core/SkPictureShader.cpp ('k') | 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 #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
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
OLDNEW
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698