| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "platform/graphics/GraphicsContextState.h" | 6 #include "platform/graphics/GraphicsContextState.h" |
| 7 | 7 |
| 8 namespace WebCore { | 8 namespace WebCore { |
| 9 | 9 |
| 10 GraphicsContextState::GraphicsContextState() | 10 GraphicsContextState::GraphicsContextState() |
| 11 : m_fillColor(Color::black) | 11 : m_fillColor(Color::black) |
| 12 , m_fillRule(RULE_NONZERO) | 12 , m_fillRule(RULE_NONZERO) |
| 13 , m_textDrawingMode(TextModeFill) | 13 , m_textDrawingMode(TextModeFill) |
| 14 , m_alpha(256) | 14 , m_alpha(256) |
| 15 , m_xferMode(nullptr) | 15 , m_xferMode(nullptr) |
| 16 , m_compositeOperator(CompositeSourceOver) | 16 , m_compositeOperator(CompositeSourceOver) |
| 17 , m_blendMode(blink::WebBlendModeNormal) | 17 , m_blendMode(blink::WebBlendModeNormal) |
| 18 #if USE(LOW_QUALITY_IMAGE_INTERPOLATION) | 18 , m_interpolationQuality(InterpolationDefault) |
| 19 , m_interpolationQuality(InterpolationLow) | |
| 20 #else | |
| 21 , m_interpolationQuality(InterpolationHigh) | |
| 22 #endif | |
| 23 , m_saveCount(0) | 19 , m_saveCount(0) |
| 24 , m_shouldAntialias(true) | 20 , m_shouldAntialias(true) |
| 25 , m_shouldSmoothFonts(true) | 21 , m_shouldSmoothFonts(true) |
| 26 , m_shouldClampToSourceRect(true) | 22 , m_shouldClampToSourceRect(true) |
| 27 { | 23 { |
| 28 m_strokePaint.setStyle(SkPaint::kStroke_Style); | 24 m_strokePaint.setStyle(SkPaint::kStroke_Style); |
| 29 m_strokePaint.setStrokeWidth(SkFloatToScalar(m_strokeData.thickness())); | 25 m_strokePaint.setStrokeWidth(SkFloatToScalar(m_strokeData.thickness())); |
| 30 m_strokePaint.setColor(applyAlpha(m_strokeData.color().rgb())); | 26 m_strokePaint.setColor(applyAlpha(m_strokeData.color().rgb())); |
| 31 m_strokePaint.setStrokeCap(SkPaint::kDefault_Cap); | 27 m_strokePaint.setStrokeCap(SkPaint::kDefault_Cap); |
| 32 m_strokePaint.setStrokeJoin(SkPaint::kDefault_Join); | 28 m_strokePaint.setStrokeJoin(SkPaint::kDefault_Join); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 241 |
| 246 void GraphicsContextState::setShouldAntialias(bool shouldAntialias) | 242 void GraphicsContextState::setShouldAntialias(bool shouldAntialias) |
| 247 { | 243 { |
| 248 m_shouldAntialias = shouldAntialias; | 244 m_shouldAntialias = shouldAntialias; |
| 249 m_strokePaint.setAntiAlias(shouldAntialias); | 245 m_strokePaint.setAntiAlias(shouldAntialias); |
| 250 m_fillPaint.setAntiAlias(shouldAntialias); | 246 m_fillPaint.setAntiAlias(shouldAntialias); |
| 251 } | 247 } |
| 252 | 248 |
| 253 | 249 |
| 254 } // namespace WebCore | 250 } // namespace WebCore |
| OLD | NEW |