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

Side by Side Diff: include/effects/SkPictureImageFilter.h

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 | « no previous file | src/core/SkPictureShader.h » ('j') | 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 #ifndef SkPictureImageFilter_DEFINED 8 #ifndef SkPictureImageFilter_DEFINED
9 #define SkPictureImageFilter_DEFINED 9 #define SkPictureImageFilter_DEFINED
10 10
11 #include "SkImageFilter.h" 11 #include "SkImageFilter.h"
12 #include "SkPicture.h" 12 #include "SkPicture.h"
13 13
14 class SK_API SkPictureImageFilter : public SkImageFilter { 14 class SK_API SkPictureImageFilter : public SkImageFilter {
15 public: 15 public:
16 /** 16 /**
17 * Refs the passed-in picture. 17 * Refs the passed-in picture.
18 */ 18 */
19 static SkPictureImageFilter* Create(SkPicture* picture) { 19 static SkPictureImageFilter* Create(const SkPicture* picture) {
20 return SkNEW_ARGS(SkPictureImageFilter, (picture)); 20 return SkNEW_ARGS(SkPictureImageFilter, (picture));
21 } 21 }
22 22
23 /** 23 /**
24 * Refs the passed-in picture. cropRect can be used to crop or expand the d estination rect when 24 * Refs the passed-in picture. cropRect can be used to crop or expand the d estination rect when
25 * the picture is drawn. (No scaling is implied by the dest rect; only the CTM is applied.) 25 * the picture is drawn. (No scaling is implied by the dest rect; only the CTM is applied.)
26 */ 26 */
27 static SkPictureImageFilter* Create(SkPicture* picture, const SkRect& cropRe ct) { 27 static SkPictureImageFilter* Create(const SkPicture* picture, const SkRect& cropRect) {
28 return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect)); 28 return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect));
29 } 29 }
30 30
31 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter) 31 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter)
32 32
33 protected: 33 protected:
34 explicit SkPictureImageFilter(SkPicture* picture); 34 explicit SkPictureImageFilter(const SkPicture* picture);
35 SkPictureImageFilter(SkPicture* picture, const SkRect& cropRect); 35 SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect);
36 virtual ~SkPictureImageFilter(); 36 virtual ~SkPictureImageFilter();
37 /* Constructs an SkPictureImageFilter object from an SkReadBuffer. 37 /* Constructs an SkPictureImageFilter object from an SkReadBuffer.
38 * Note: If the SkPictureImageFilter object construction requires bitmap 38 * Note: If the SkPictureImageFilter object construction requires bitmap
39 * decoding, the decoder must be set on the SkReadBuffer parameter by calli ng 39 * decoding, the decoder must be set on the SkReadBuffer parameter by calli ng
40 * SkReadBuffer::setBitmapDecoder() before calling this constructor. 40 * SkReadBuffer::setBitmapDecoder() before calling this constructor.
41 * @param SkReadBuffer Serialized picture data. 41 * @param SkReadBuffer Serialized picture data.
42 */ 42 */
43 explicit SkPictureImageFilter(SkReadBuffer&); 43 explicit SkPictureImageFilter(SkReadBuffer&);
44 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 44 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
45 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, 45 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
46 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE; 46 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE;
47 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, 47 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
48 SkIRect* dst) const SK_OVERRIDE; 48 SkIRect* dst) const SK_OVERRIDE;
49 49
50 private: 50 private:
51 SkPicture* fPicture; 51 const SkPicture* fPicture;
52 SkRect fCropRect; 52 SkRect fCropRect;
53 typedef SkImageFilter INHERITED; 53 typedef SkImageFilter INHERITED;
54 }; 54 };
55 55
56 #endif 56 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkPictureShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698