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

Unified Diff: include/effects/SkImageSource.h

Issue 1343703005: SkImageSource (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review comments Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/effects.gypi ('k') | src/core/SkPictureData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkImageSource.h
diff --git a/include/effects/SkImageSource.h b/include/effects/SkImageSource.h
new file mode 100644
index 0000000000000000000000000000000000000000..56c6a6e96a366a01f5600d4c3a027d498633bba5
--- /dev/null
+++ b/include/effects/SkImageSource.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkImageSource_DEFINED
+#define SkImageSource_DEFINED
+
+#include "SkImageFilter.h"
+
+class SkImage;
+
+class SK_API SkImageSource : public SkImageFilter {
+public:
+ static SkImageFilter* Create(const SkImage*);
+ static SkImageFilter* Create(const SkImage*,
+ const SkRect& srcRect,
+ const SkRect& dstRect,
+ SkFilterQuality);
+
+ void computeFastBounds(const SkRect& src, SkRect* dst) const override;
+
+ SK_TO_STRING_OVERRIDE()
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkImageSource)
+
+protected:
+ void flatten(SkWriteBuffer&) const override;
+
+ bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
+ SkBitmap* result, SkIPoint* offset) const override;
+
+private:
+ explicit SkImageSource(const SkImage*);
+ SkImageSource(const SkImage*,
+ const SkRect& srcRect,
+ const SkRect& dstRect,
+ SkFilterQuality);
+
+ SkAutoTUnref<const SkImage> fImage;
+ SkRect fSrcRect, fDstRect;
+ SkFilterQuality fFilterQuality;
+
+ typedef SkImageFilter INHERITED;
+};
+
+#endif
« no previous file with comments | « gyp/effects.gypi ('k') | src/core/SkPictureData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698