Chromium Code Reviews| 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 #include "platform/graphics/skia/SkiaUtils.h" | 8 #include "platform/graphics/skia/SkiaUtils.h" |
| 9 | 9 |
| 10 namespace WebCore { | 10 namespace WebCore { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 , m_compositeOperator(other.m_compositeOperator) | 52 , m_compositeOperator(other.m_compositeOperator) |
| 53 , m_blendMode(other.m_blendMode) | 53 , m_blendMode(other.m_blendMode) |
| 54 , m_interpolationQuality(other.m_interpolationQuality) | 54 , m_interpolationQuality(other.m_interpolationQuality) |
| 55 , m_saveCount(0) | 55 , m_saveCount(0) |
| 56 , m_shouldAntialias(other.m_shouldAntialias) | 56 , m_shouldAntialias(other.m_shouldAntialias) |
| 57 , m_shouldSmoothFonts(other.m_shouldSmoothFonts) | 57 , m_shouldSmoothFonts(other.m_shouldSmoothFonts) |
| 58 , m_shouldClampToSourceRect(other.m_shouldClampToSourceRect) { } | 58 , m_shouldClampToSourceRect(other.m_shouldClampToSourceRect) { } |
| 59 | 59 |
| 60 void GraphicsContextState::copy(const GraphicsContextState& source) | 60 void GraphicsContextState::copy(const GraphicsContextState& source) |
| 61 { | 61 { |
| 62 this->~GraphicsContextState(); | |
|
jbroman
2014/06/12 13:43:07
Wouldn't it be more straightforward to just make t
Dominik Grewe
2014/06/12 13:50:19
We mainly did this to avoid code duplication. But
| |
| 62 new (this) GraphicsContextState(source); | 63 new (this) GraphicsContextState(source); |
| 63 } | 64 } |
| 64 | 65 |
| 65 const SkPaint& GraphicsContextState::strokePaint(int strokedPathLength) const | 66 const SkPaint& GraphicsContextState::strokePaint(int strokedPathLength) const |
| 66 { | 67 { |
| 67 if (m_strokeData.gradient() && m_strokeData.gradient()->shaderChanged()) | 68 if (m_strokeData.gradient() && m_strokeData.gradient()->shaderChanged()) |
| 68 m_strokePaint.setShader(m_strokeData.gradient()->shader()); | 69 m_strokePaint.setShader(m_strokeData.gradient()->shader()); |
| 69 m_strokeData.setupPaintDashPathEffect(&m_strokePaint, strokedPathLength); | 70 m_strokeData.setupPaintDashPathEffect(&m_strokePaint, strokedPathLength); |
| 70 return m_strokePaint; | 71 return m_strokePaint; |
| 71 } | 72 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 | 247 |
| 247 void GraphicsContextState::setShouldAntialias(bool shouldAntialias) | 248 void GraphicsContextState::setShouldAntialias(bool shouldAntialias) |
| 248 { | 249 { |
| 249 m_shouldAntialias = shouldAntialias; | 250 m_shouldAntialias = shouldAntialias; |
| 250 m_strokePaint.setAntiAlias(shouldAntialias); | 251 m_strokePaint.setAntiAlias(shouldAntialias); |
| 251 m_fillPaint.setAntiAlias(shouldAntialias); | 252 m_fillPaint.setAntiAlias(shouldAntialias); |
| 252 } | 253 } |
| 253 | 254 |
| 254 | 255 |
| 255 } // namespace WebCore | 256 } // namespace WebCore |
| OLD | NEW |