aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-20 15:43:14 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-20 15:43:14 +0000
commitbf2768bab9f3b21c03a8f9a75dc891231d5857cc (patch)
treedff283832643ef25a7361eee0566afabe206c406 /src
parent28136b308fe467da113983cfee332faea133cd8a (diff)
Refactor SkImageFilter into its own .cpp file.
Review URL: https://codereview.appspot.com/6465073/ git-svn-id: http://skia.googlecode.com/svn/trunk@5188 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkImageFilter.cpp54
-rw-r--r--src/core/SkPaint.cpp47
2 files changed, 54 insertions, 47 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
new file mode 100644
index 0000000000..21582bd2db
--- /dev/null
+++ b/src/core/SkImageFilter.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2012 The Android Open Source Project
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkImageFilter.h"
+#include "SkRect.h"
+
+SK_DEFINE_INST_COUNT(SkImageFilter)
+
+bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src,
+ const SkMatrix& ctm,
+ SkBitmap* result, SkIPoint* loc) {
+ SkASSERT(result);
+ SkASSERT(loc);
+ /*
+ * Give the proxy first shot at the filter. If it returns false, ask
+ * the filter to do it.
+ */
+ return (proxy && proxy->filterImage(this, src, ctm, result, loc)) ||
+ this->onFilterImage(proxy, src, ctm, result, loc);
+}
+
+bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm,
+ SkIRect* dst) {
+ SkASSERT(&src);
+ SkASSERT(dst);
+ return this->onFilterBounds(src, ctm, dst);
+}
+
+bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const SkMatrix&,
+ SkBitmap*, SkIPoint*) {
+ return false;
+}
+
+bool SkImageFilter::canFilterImageGPU() const {
+ return false;
+}
+
+GrTexture* SkImageFilter::onFilterImageGPU(GrTexture* texture, const SkRect& rect) {
+ return NULL;
+}
+
+bool SkImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
+ SkIRect* dst) {
+ *dst = src;
+ return true;
+}
+
+bool SkImageFilter::asNewCustomStage(GrCustomStage**, GrTexture*) const {
+ return false;
+}
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 0f1aecf977..06058ab004 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2304,53 +2304,6 @@ bool SkPaint::nothingToDraw() const {
//////////// Move these to their own file soon.
-SK_DEFINE_INST_COUNT(SkImageFilter)
-
-bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src,
- const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* loc) {
- SkASSERT(result);
- SkASSERT(loc);
- /*
- * Give the proxy first shot at the filter. If it returns false, ask
- * the filter to do it.
- */
- return (proxy && proxy->filterImage(this, src, ctm, result, loc)) ||
- this->onFilterImage(proxy, src, ctm, result, loc);
-}
-
-bool SkImageFilter::filterBounds(const SkIRect& src, const SkMatrix& ctm,
- SkIRect* dst) {
- SkASSERT(&src);
- SkASSERT(dst);
- return this->onFilterBounds(src, ctm, dst);
-}
-
-bool SkImageFilter::onFilterImage(Proxy*, const SkBitmap&, const SkMatrix&,
- SkBitmap*, SkIPoint*) {
- return false;
-}
-
-bool SkImageFilter::canFilterImageGPU() const {
- return false;
-}
-
-GrTexture* SkImageFilter::onFilterImageGPU(GrTexture* texture, const SkRect& rect) {
- return NULL;
-}
-
-bool SkImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
- SkIRect* dst) {
- *dst = src;
- return true;
-}
-
-bool SkImageFilter::asNewCustomStage(GrCustomStage**, GrTexture*) const {
- return false;
-}
-
-////////////////////
-
SK_DEFINE_INST_COUNT(SkDrawLooper)
bool SkDrawLooper::canComputeFastBounds(const SkPaint& paint) {