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

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

Issue 17448009: Use skia::RefPtr to avoid having to manually refcount GraphicsContextState::m_looper. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: switch to skia::RefPtr, remove superfluous copy of m_imageBufferClip Created 7 years, 6 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: Source/core/platform/graphics/GraphicsContextState.h
diff --git a/Source/core/platform/graphics/GraphicsContextState.h b/Source/core/platform/graphics/GraphicsContextState.h
index 59396b8d996ba1e6ca2caa02372a1dcb96118552..25ddc9fb0b03d8de28eae2225574049384b47fe4 100644
--- a/Source/core/platform/graphics/GraphicsContextState.h
+++ b/Source/core/platform/graphics/GraphicsContextState.h
@@ -34,11 +34,10 @@
#include "core/platform/graphics/Path.h"
#include "core/platform/graphics/Pattern.h"
#include "core/platform/graphics/StrokeData.h"
-
+#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkDrawLooper.h"
#include "third_party/skia/include/effects/SkDashPathEffect.h"
-
#include "wtf/PassOwnPtr.h"
namespace WebCore {
@@ -47,10 +46,7 @@ namespace WebCore {
// Only GraphicsContext can use this class.
class GraphicsContextState {
public:
- ~GraphicsContextState()
- {
- SkSafeUnref(m_looper);
- }
+ ~GraphicsContextState() { }
private:
friend class GraphicsContext;
@@ -58,7 +54,6 @@ private:
GraphicsContextState()
: m_fillColor(Color::black)
, m_fillRule(RULE_NONZERO)
- , m_looper(0)
, m_textDrawingMode(TextModeFill)
, m_alpha(1)
, m_xferMode(SkXfermode::kSrcOver_Mode)
@@ -88,19 +83,12 @@ private:
, m_xferMode(other.m_xferMode)
, m_compositeOperator(other.m_compositeOperator)
, m_blendMode(other.m_blendMode)
- , m_imageBufferClip(other.m_imageBufferClip)
, m_clip(other.m_clip)
, m_interpolationQuality(other.m_interpolationQuality)
, m_shouldAntialias(other.m_shouldAntialias)
, m_shouldSmoothFonts(other.m_shouldSmoothFonts)
, m_shadowsIgnoreTransforms(other.m_shadowsIgnoreTransforms)
{
- // Up the ref count of these. SkSafeRef does nothing if its argument is 0.
- SkSafeRef(m_looper);
-
- // The clip image only needs to be applied once. Reset the image so that we
- // don't attempt to clip multiple times.
- m_imageBufferClip.reset();
}
// Helper function for applying the state's alpha value to the given input
@@ -133,7 +121,7 @@ private:
RefPtr<Pattern> m_fillPattern;
// Shadow. (This will need tweaking if we use draw loopers for other things.)
- SkDrawLooper* m_looper;
+ skia::RefPtr<SkDrawLooper> m_looper;
// Text. (See TextModeFill & friends.)
TextDrawingModeFlags m_textDrawingMode;

Powered by Google App Engine
This is Rietveld 408576698