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

Unified Diff: Source/core/platform/graphics/DrawLooper.h

Issue 15137009: Refactor shadow rendering logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: merge upstream changes Created 7 years, 7 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 | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/platform/graphics/DrawLooper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/DrawLooper.h
diff --git a/Source/core/css/resolver/TransformBuilder.h b/Source/core/platform/graphics/DrawLooper.h
similarity index 56%
copy from Source/core/css/resolver/TransformBuilder.h
copy to Source/core/platform/graphics/DrawLooper.h
index 8807205dac541fa3339f15c2e4bba92f22763d44..6bfdfc4ffe74c526e19b12298461bd0647e711b0 100644
--- a/Source/core/css/resolver/TransformBuilder.h
+++ b/Source/core/platform/graphics/DrawLooper.h
@@ -28,26 +28,53 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TransformBuilder_h
-#define TransformBuilder_h
+#ifndef DrawLooper_h
+#define DrawLooper_h
-#include "core/platform/graphics/transforms/TransformOperations.h"
+#include "third_party/skia/include/core/SkDrawLooper.h"
+
+// SkPaint and SkPoint are needed before SkLayerDrawLooper.h; they should be #included there.
+// Can be removed once https://codereview.chromium.org/14607015/ is submitted.
+#include "third_party/skia/include/core/SkPaint.h"
+#include "third_party/skia/include/core/SkPoint.h"
+
+#include "third_party/skia/include/core/SkRefCnt.h"
+#include "third_party/skia/include/effects/SkLayerDrawLooper.h"
#include "wtf/Noncopyable.h"
namespace WebCore {
-class RenderStyle;
-class CSSValue;
+class Color;
+class FloatSize;
+
+class DrawLooper {
+ // Implementing the copy constructor properly would require writing code to
+ // copy the underlying SkDrawLooper.
+ WTF_MAKE_NONCOPYABLE(DrawLooper);
-class TransformBuilder {
- WTF_MAKE_NONCOPYABLE(TransformBuilder); WTF_MAKE_FAST_ALLOCATED;
public:
- TransformBuilder();
- ~TransformBuilder();
+ enum ShadowTransformMode {
+ ShadowRespectsTransforms,
+ ShadowIgnoresTransforms
+ };
+ enum ShadowAlphaMode {
+ ShadowRespectsAlpha,
+ ShadowIgnoresAlpha
+ };
+
+ DrawLooper();
+ ~DrawLooper() { }
+ SkLayerDrawLooper* skDrawLooper() { return m_skDrawLooper.get(); }
+
+ void addUnmodifiedContent();
+ void addShadow(const FloatSize& offset, float blur, const Color&,
+ ShadowTransformMode = ShadowRespectsTransforms,
+ ShadowAlphaMode = ShadowRespectsAlpha);
- static bool createTransformOperations(CSSValue* inValue, RenderStyle* inStyle, RenderStyle* rootStyle, TransformOperations& outOperations);
+private:
+ SkAutoTUnref<SkLayerDrawLooper> m_skDrawLooper;
};
} // namespace WebCore
-#endif // TransformBuilder_h
+#endif // DrawLooper_h
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/platform/graphics/DrawLooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698