summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Chromium Automerger <chromium-automerger@android>2014-04-30 06:43:04 +0000
committerAndroid Chromium Automerger <chromium-automerger@android>2014-04-30 06:43:04 +0000
commitfad7d51df7e53b3ff30c0842150288e4b4f3f107 (patch)
treed674b988ab30208fb952619e98a2284d77cdf5b0
parent9bb83f38d89e64a6b1b34e3f11d5dcbbd837360c (diff)
parent394ec1d498fc2f93a45c150aa8ad24bec26c3760 (diff)
downloadinclude-fad7d51df7e53b3ff30c0842150288e4b4f3f107.tar.gz
Merge third_party/skia/include from https://chromium.googlesource.com/external/skia/include.git at 394ec1d498fc2f93a45c150aa8ad24bec26c3760
This commit was generated by merge_from_chromium.py. Change-Id: I856ef4fed1234dcbe0f3fd6bc2a6a4c48afb7411
-rw-r--r--core/SkDrawLooper.h21
-rw-r--r--core/SkMaskFilter.h13
-rw-r--r--core/SkReader32.h2
-rw-r--r--effects/SkBlurDrawLooper.h5
-rw-r--r--effects/SkEmbossMaskFilter.h4
-rw-r--r--effects/SkLayerDrawLooper.h2
-rw-r--r--effects/SkMatrixConvolutionImageFilter.h2
-rw-r--r--effects/SkTileImageFilter.h2
8 files changed, 46 insertions, 5 deletions
diff --git a/core/SkDrawLooper.h b/core/SkDrawLooper.h
index cc42952..b92bacc 100644
--- a/core/SkDrawLooper.h
+++ b/core/SkDrawLooper.h
@@ -10,7 +10,10 @@
#ifndef SkDrawLooper_DEFINED
#define SkDrawLooper_DEFINED
+#include "SkBlurTypes.h"
#include "SkFlattenable.h"
+#include "SkPoint.h"
+#include "SkColor.h"
class SkCanvas;
class SkPaint;
@@ -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)
diff --git a/core/SkMaskFilter.h b/core/SkMaskFilter.h
index 3113c93..8051e7d 100644
--- a/core/SkMaskFilter.h
+++ b/core/SkMaskFilter.h
@@ -10,6 +10,7 @@
#ifndef SkMaskFilter_DEFINED
#define SkMaskFilter_DEFINED
+#include "SkBlurTypes.h"
#include "SkFlattenable.h"
#include "SkMask.h"
#include "SkPaint.h"
@@ -138,6 +139,18 @@ public:
*/
virtual void computeFastBounds(const SkRect& src, SkRect* dest) const;
+ struct BlurRec {
+ SkScalar fSigma;
+ SkBlurStyle fStyle;
+ SkBlurQuality fQuality;
+ };
+ /**
+ * If this filter can be represented by a BlurRec, return true and (if not null) fill in the
+ * provided BlurRec parameter. If this effect cannot be represented as a BlurRec, return false
+ * and ignore the BlurRec parameter.
+ */
+ virtual bool asABlur(BlurRec*) const;
+
SK_TO_STRING_PUREVIRT()
SK_DEFINE_FLATTENABLE_TYPE(SkMaskFilter)
diff --git a/core/SkReader32.h b/core/SkReader32.h
index 7e8038d..51e28ef 100644
--- a/core/SkReader32.h
+++ b/core/SkReader32.h
@@ -40,7 +40,7 @@ public:
const void* peek() const { return fCurr; }
size_t available() const { return fStop - fCurr; }
- bool isAvailable(size_t size) const { return fCurr + size <= fStop; }
+ bool isAvailable(size_t size) const { return size <= this->available(); }
void rewind() { fCurr = fBase; }
diff --git a/effects/SkBlurDrawLooper.h b/effects/SkBlurDrawLooper.h
index fe945c3..75ed80e 100644
--- a/effects/SkBlurDrawLooper.h
+++ b/effects/SkBlurDrawLooper.h
@@ -61,10 +61,12 @@ protected:
SkBlurDrawLooper(SkReadBuffer&);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+ virtual bool asABlurShadow(BlurShadowRec*) const SK_OVERRIDE;
+
private:
SkMaskFilter* fBlur;
SkColorFilter* fColorFilter;
- SkScalar fDx, fDy;
+ SkScalar fDx, fDy, fSigma;
SkColor fBlurColor;
uint32_t fBlurFlags;
@@ -86,6 +88,7 @@ private:
};
void init(SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color, uint32_t flags);
+ void initEffects();
typedef SkDrawLooper INHERITED;
};
diff --git a/effects/SkEmbossMaskFilter.h b/effects/SkEmbossMaskFilter.h
index eb8f811..65dbbe7 100644
--- a/effects/SkEmbossMaskFilter.h
+++ b/effects/SkEmbossMaskFilter.h
@@ -23,9 +23,7 @@ public:
uint8_t fSpecular; // exponent, 4.4 right now
};
- static SkEmbossMaskFilter* Create(SkScalar blurSigma, const Light& light) {
- return SkNEW_ARGS(SkEmbossMaskFilter, (blurSigma, light));
- }
+ static SkEmbossMaskFilter* Create(SkScalar blurSigma, const Light& light);
// overrides from SkMaskFilter
// This method is not exported to java.
diff --git a/effects/SkLayerDrawLooper.h b/effects/SkLayerDrawLooper.h
index fe660a8..ac56e28 100644
--- a/effects/SkLayerDrawLooper.h
+++ b/effects/SkLayerDrawLooper.h
@@ -77,6 +77,8 @@ public:
virtual size_t contextSize() const SK_OVERRIDE { return sizeof(LayerDrawLooperContext); }
+ virtual bool asABlurShadow(BlurShadowRec* rec) const SK_OVERRIDE;
+
SK_TO_STRING_OVERRIDE()
/// Implements Flattenable.
diff --git a/effects/SkMatrixConvolutionImageFilter.h b/effects/SkMatrixConvolutionImageFilter.h
index 5b02fba..ee1bfcf 100644
--- a/effects/SkMatrixConvolutionImageFilter.h
+++ b/effects/SkMatrixConvolutionImageFilter.h
@@ -73,6 +73,8 @@ protected:
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
+ virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const SK_OVERRIDE;
+
#if SK_SUPPORT_GPU
virtual bool asNewEffect(GrEffectRef** effect,
diff --git a/effects/SkTileImageFilter.h b/effects/SkTileImageFilter.h
index 6c0fa68..c26ae9a 100644
--- a/effects/SkTileImageFilter.h
+++ b/effects/SkTileImageFilter.h
@@ -26,6 +26,8 @@ public:
virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
SkBitmap* dst, SkIPoint* offset) const SK_OVERRIDE;
+ virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
+ SkIRect* dst) const SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter)