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

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

Issue 18551004: Miscellaneous cleanup to reduce number of includes in platform/graphics/ Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 37b5e70bd6db2da4ea8022a065468e714168f09c..2ad5fe825171c344e8f90402be81e8a0b9e97135 100644
--- a/Source/core/platform/graphics/GraphicsContextState.h
+++ b/Source/core/platform/graphics/GraphicsContextState.h
@@ -29,17 +29,16 @@
#ifndef GraphicsContextState_h
#define GraphicsContextState_h
-#include "core/platform/graphics/Gradient.h"
#include "core/platform/graphics/GraphicsTypes.h"
-#include "core/platform/graphics/Path.h"
-#include "core/platform/graphics/Pattern.h"
#include "core/platform/graphics/StrokeData.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 "core/platform/graphics/WindRule.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "third_party/skia/include/core/SkRect.h"
+#include "third_party/skia/include/core/SkXfermode.h"
#include "wtf/PassOwnPtr.h"
+#include "wtf/RefPtr.h"
+
+class SkDrawLooper;
namespace WebCore {
@@ -47,73 +46,13 @@ namespace WebCore {
// Only GraphicsContext can use this class.
class GraphicsContextState {
public:
- ~GraphicsContextState()
- {
- SkSafeUnref(m_looper);
- }
+ ~GraphicsContextState();
private:
friend class GraphicsContext;
- GraphicsContextState()
- : m_fillColor(Color::black)
- , m_fillRule(RULE_NONZERO)
- , m_looper(0)
- , m_textDrawingMode(TextModeFill)
- , m_alpha(1)
- , m_xferMode(SkXfermode::kSrcOver_Mode)
- , m_compositeOperator(CompositeSourceOver)
- , m_blendMode(BlendModeNormal)
- , m_clip(SkRect::MakeEmpty())
-#if USE(LOW_QUALITY_IMAGE_INTERPOLATION)
- , m_interpolationQuality(InterpolationLow)
-#else
- , m_interpolationQuality(InterpolationHigh)
-#endif
- , m_shouldAntialias(true)
- , m_shouldSmoothFonts(true)
- {
- }
-
- GraphicsContextState(const GraphicsContextState& other)
- : m_strokeData(other.m_strokeData)
- , m_fillColor(other.m_fillColor)
- , m_fillRule(other.m_fillRule)
- , m_fillGradient(other.m_fillGradient)
- , m_fillPattern(other.m_fillPattern)
- , m_looper(other.m_looper)
- , m_textDrawingMode(other.m_textDrawingMode)
- , m_alpha(other.m_alpha)
- , 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)
- {
- // 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
- // color to produce a new output color.
- SkColor applyAlpha(SkColor c) const
- {
- int s = roundf(m_alpha * 256);
- if (s >= 256)
- return c;
- if (s < 0)
- return 0;
-
- int a = SkAlphaMul(SkColorGetA(c), s);
- return (c & 0x00FFFFFF) | (a << 24);
- }
+ GraphicsContextState();
+ GraphicsContextState(const GraphicsContextState& other);
// Returns a new State with all of this object's inherited properties copied.
PassOwnPtr<GraphicsContextState> clone() { return adoptPtr(new GraphicsContextState(*this)); }
« no previous file with comments | « Source/core/platform/graphics/GraphicsContextAnnotation.h ('k') | Source/core/platform/graphics/GraphicsContextState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698