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

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

Issue 23507002: Revert 156733 "Refactoring DrawLooper so that it can apply shado..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 7 years, 4 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: trunk/Source/core/platform/graphics/DrawLooper.h
===================================================================
--- trunk/Source/core/platform/graphics/DrawLooper.h (revision 156736)
+++ trunk/Source/core/platform/graphics/DrawLooper.h (working copy)
@@ -31,22 +31,18 @@
#ifndef DrawLooper_h
#define DrawLooper_h
-#include "SkRefCnt.h"
-#include "core/platform/graphics/Color.h"
-#include "core/platform/graphics/FloatSize.h"
#include "wtf/Noncopyable.h"
-#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
-#include "wtf/Vector.h"
-class SkBitmap;
class SkDrawLooper;
-class SkImageFilter;
class SkLayerDrawLooper;
namespace WebCore {
-class DrawLooper : public RefCounted<DrawLooper> {
+class Color;
+class FloatSize;
+
+class DrawLooper {
// Implementing the copy constructor properly would require writing code to
// copy the underlying SkDrawLooper.
WTF_MAKE_NONCOPYABLE(DrawLooper);
@@ -67,39 +63,14 @@
// Callees should not modify this looper other than to iterate over it.
// A downcast to SkLayerDrawLooper* is tantamount to a const_cast.
SkDrawLooper* skDrawLooper() const;
- SkImageFilter* imageFilter() const;
void addUnmodifiedContent();
void addShadow(const FloatSize& offset, float blur, const Color&,
ShadowTransformMode = ShadowRespectsTransforms,
ShadowAlphaMode = ShadowRespectsAlpha);
- bool shouldUseImageFilterToDrawBitmap(const SkBitmap&) const;
-
private:
- enum LayerType {
- ShadowLayer,
- UnmodifiedLayer
- };
- void clearCached();
- void buildCachedDrawLooper() const;
- void buildCachedImageFilter() const;
-
- struct DrawLooperLayerInfo {
- FloatSize m_offset;
- float m_blur;
- Color m_color;
- ShadowTransformMode m_shadowTransformMode;
- ShadowAlphaMode m_shadowAlphaMode;
- LayerType m_layerType;
- };
-
- typedef Vector<DrawLooperLayerInfo, 2> LayerVector;
-
- LayerVector m_layerInfo;
-
- mutable RefPtr<SkLayerDrawLooper> m_cachedDrawLooper;
- mutable RefPtr<SkImageFilter> m_cachedImageFilter;
+ RefPtr<SkLayerDrawLooper> m_skDrawLooper;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698