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

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

Issue 26220004: SkRectShaderImageFilter: add a new factory method which takes a CropRect. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/effects/SkRectShaderImageFilter.cpp » ('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 Google Inc. 2 * Copyright 2013 Google Inc.
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 SkRectShaderImageFilter_DEFINED 8 #ifndef SkRectShaderImageFilter_DEFINED
9 #define SkRectShaderImageFilter_DEFINED 9 #define SkRectShaderImageFilter_DEFINED
10 10
11 #include "SkImageFilter.h" 11 #include "SkImageFilter.h"
12 #include "SkRect.h" 12 #include "SkRect.h"
13 13
14 class SkShader; 14 class SkShader;
15 15
16 class SK_API SkRectShaderImageFilter : public SkImageFilter { 16 class SK_API SkRectShaderImageFilter : public SkImageFilter {
17 public: 17 public:
18 /** 18 /**
19 * The SkShader object will have its refcnt increased as it becomes a membe r of the 19 * The SkShader object will have its refcnt increased as it becomes a membe r of the
20 * SkRectShaderImageFilter object returned by this function. It cannot be N ULL. 20 * SkRectShaderImageFilter object returned by this function. It cannot be N ULL.
21 * The region parameter is used to specify on which region the shader is ap plied. 21 * The region parameter is used to specify on which region the shader is ap plied.
reed1 2013/10/14 12:45:57 1. "region"? 2. It appears now that the rect/regio
22 */ 22 */
23 static SkRectShaderImageFilter* Create(SkShader* s, const SkRect& rect); 23 static SkRectShaderImageFilter* Create(SkShader* s, const SkRect& rect);
24 static SkRectShaderImageFilter* Create(SkShader* s, const CropRect* rect = N ULL);
24 virtual ~SkRectShaderImageFilter(); 25 virtual ~SkRectShaderImageFilter();
25 26
26 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkRectShaderImageFilter) 27 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkRectShaderImageFilter)
27 28
28 protected: 29 protected:
29 SkRectShaderImageFilter(SkFlattenableReadBuffer& buffer); 30 SkRectShaderImageFilter(SkFlattenableReadBuffer& buffer);
30 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 31 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
31 32
32 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 33 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
33 SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; 34 SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
34 35
35 private: 36 private:
36 SkRectShaderImageFilter(SkShader* s, const CropRect* rect); 37 SkRectShaderImageFilter(SkShader* s, const CropRect* rect);
37 SkShader* fShader; 38 SkShader* fShader;
38 39
39 typedef SkImageFilter INHERITED; 40 typedef SkImageFilter INHERITED;
40 }; 41 };
41 42
42 #endif 43 #endif
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkRectShaderImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698