Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / include / core / SkDrawLooper.h
index 3c45a6a..b92bacc 100644 (file)
 #ifndef SkDrawLooper_DEFINED
 #define SkDrawLooper_DEFINED
 
+#include "SkBlurTypes.h"
 #include "SkFlattenable.h"
+#include "SkPoint.h"
+#include "SkColor.h"
 
 class SkCanvas;
 class SkPaint;
@@ -35,7 +38,7 @@ public:
      *  Subclasses of SkDrawLooper should create a subclass of this object to
      *  hold state specific to their subclass.
      */
-    class SK_API Context : public SkNoncopyable {
+    class SK_API Context : ::SkNoncopyable {
     public:
         Context() {}
         virtual ~Context() {}
@@ -88,6 +91,24 @@ public:
     virtual void computeFastBounds(const SkPaint& paint,
                                    const SkRect& src, SkRect* dst) const;
 
+    struct BlurShadowRec {
+        SkScalar        fSigma;
+        SkVector        fOffset;
+        SkColor         fColor;
+        SkBlurStyle     fStyle;
+        SkBlurQuality   fQuality;
+    };
+    /**
+     *  If this looper can be interpreted as having two layers, such that
+     *      1. The first layer (bottom most) just has a blur and translate
+     *      2. The second layer has no modifications to either paint or canvas
+     *      3. No other layers.
+     *  then return true, and if not null, fill out the BlurShadowRec).
+     *
+     *  If any of the above are not met, return false and ignore the BlurShadowRec parameter.
+     */
+    virtual bool asABlurShadow(BlurShadowRec*) const;
+
     SK_TO_STRING_PUREVIRT()
     SK_DEFINE_FLATTENABLE_TYPE(SkDrawLooper)