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

Unified Diff: src/core/SkPictureShader.h

Issue 221923007: Initial picture shader implementation (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Win build fix + SkShader factory. Created 6 years, 9 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
Index: src/core/SkPictureShader.h
diff --git a/src/core/SkPictureShader.h b/src/core/SkPictureShader.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e60064106a6ec3801013c303af89285ffd3c478
--- /dev/null
+++ b/src/core/SkPictureShader.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkPictureShader_DEFINED
+#define SkPictureShader_DEFINED
+
+#include "SkShader.h"
+
+class SkBitmap;
+class SkPicture;
+
robertphillips 2014/04/02 18:15:35 // The SkPictureShader ...
f(malita) 2014/04/07 15:06:24 Done.
+class SkPictureShader : public SkShader {
reed1 2014/04/07 14:03:15 Defensively, lets keep this private, and just expo
f(malita) 2014/04/07 15:06:24 Done.
+public:
+ SkPictureShader(SkPicture*, TileMode, TileMode);
+ virtual ~SkPictureShader();
+
+ virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK_OVERRIDE;
+ virtual void endContext() SK_OVERRIDE;
+ virtual uint32_t getFlags() SK_OVERRIDE;
+
+ virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE;
+ virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE;
+ virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE;
+
+ SK_TO_STRING_OVERRIDE()
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureShader)
+
+#if SK_SUPPORT_GPU
+ GrEffectRef* asNewEffect(GrContext*, const SkPaint&) const SK_OVERRIDE;
+#endif
+
+protected:
+ SkPictureShader(SkReadBuffer&);
+ virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+
+private:
+ bool buildBitmapShader(const SkMatrix&) const;
+
robertphillips 2014/04/02 18:15:35 this should go last.
f(malita) 2014/04/07 15:06:24 Done.
+ typedef SkShader INHERITED;
+
+ SkPicture* fPicture;
+ TileMode fTmx, fTmy;
+
+ mutable SkAutoTUnref<SkShader> fCachedShader;
+ mutable SkSize fCachedTileScale;
+};
+
+#endif // SkPictureShader_DEFINED

Powered by Google App Engine
This is Rietveld 408576698