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

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

Issue 920513003: Make filters use SkImage instead of SkBitmap Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 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 SkMatrixConvolutionImageFilter_DEFINED 8 #ifndef SkMatrixConvolutionImageFilter_DEFINED
9 #define SkMatrixConvolutionImageFilter_DEFINED 9 #define SkMatrixConvolutionImageFilter_DEFINED
10 10
11 #include "SkImageFilter.h" 11 #include "SkImageFilter.h"
12 #include "SkScalar.h" 12 #include "SkScalar.h"
13 #include "SkSize.h" 13 #include "SkSize.h"
14 #include "SkPoint.h" 14 #include "SkPoint.h"
15 15
16 class SkBitmap;
17
16 /*! \class SkMatrixConvolutionImageFilter 18 /*! \class SkMatrixConvolutionImageFilter
17 Matrix convolution image filter. This filter applies an NxM image 19 Matrix convolution image filter. This filter applies an NxM image
18 processing kernel to a given input image. This can be used to produce 20 processing kernel to a given input image. This can be used to produce
19 effects such as sharpening, blurring, edge detection, etc. 21 effects such as sharpening, blurring, edge detection, etc.
20 */ 22 */
21 23
22 class SK_API SkMatrixConvolutionImageFilter : public SkImageFilter { 24 class SK_API SkMatrixConvolutionImageFilter : public SkImageFilter {
23 public: 25 public:
24 /*! \enum TileMode */ 26 /*! \enum TileMode */
25 enum TileMode { 27 enum TileMode {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 SkScalar gain, 74 SkScalar gain,
73 SkScalar bias, 75 SkScalar bias,
74 const SkIPoint& kernelOffset, 76 const SkIPoint& kernelOffset,
75 TileMode tileMode, 77 TileMode tileMode,
76 bool convolveAlpha, 78 bool convolveAlpha,
77 SkImageFilter* input, 79 SkImageFilter* input,
78 const CropRect* cropRect, 80 const CropRect* cropRect,
79 uint32_t uniqueID); 81 uint32_t uniqueID);
80 void flatten(SkWriteBuffer&) const SK_OVERRIDE; 82 void flatten(SkWriteBuffer&) const SK_OVERRIDE;
81 83
82 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, 84 virtual bool onFilterImage(Proxy*, SkImage& src, const Context&,
83 SkBitmap* result, SkIPoint* loc) const SK_OVERRID E; 85 SkAutoTUnref<SkImage>& result, SkIPoint* loc) con st SK_OVERRIDE;
84 bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const SK_OVER RIDE; 86 bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const SK_OVER RIDE;
85 87
86 88
87 #if SK_SUPPORT_GPU 89 #if SK_SUPPORT_GPU
88 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const Sk Matrix&, 90 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const Sk Matrix&,
89 const SkIRect& bounds) const SK_OVERRIDE; 91 const SkIRect& bounds) const SK_OVERRIDE;
90 #endif 92 #endif
91 93
92 private: 94 private:
93 SkISize fKernelSize; 95 SkISize fKernelSize;
(...skipping 19 matching lines...) Expand all
113 SkBitmap* result, 115 SkBitmap* result,
114 const SkIRect& rect, 116 const SkIRect& rect,
115 const SkIRect& bounds) const; 117 const SkIRect& bounds) const;
116 void filterBorderPixels(const SkBitmap& src, 118 void filterBorderPixels(const SkBitmap& src,
117 SkBitmap* result, 119 SkBitmap* result,
118 const SkIRect& rect, 120 const SkIRect& rect,
119 const SkIRect& bounds) const; 121 const SkIRect& bounds) const;
120 }; 122 };
121 123
122 #endif 124 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698