| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/css/CSSPaintValue.h" | 5 #include "core/css/CSSPaintValue.h" |
| 6 | 6 |
| 7 #include "core/css/CSSCustomIdentValue.h" | 7 #include "core/css/CSSCustomIdentValue.h" |
| 8 #include "core/layout/LayoutObject.h" | 8 #include "core/layout/LayoutObject.h" |
| 9 #include "platform/graphics/Image.h" | 9 #include "platform/graphics/Image.h" |
| 10 #include "wtf/text/StringBuilder.h" | 10 #include "wtf/text/StringBuilder.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 CSSPaintValue::CSSPaintValue(CSSCustomIdentValue* name) | 14 CSSPaintValue::CSSPaintValue(CSSCustomIdentValue* name) |
| 15 : CSSImageGeneratorValue(PaintClass) | 15 : CSSImageGeneratorValue(PaintClass) |
| 16 , m_name(name) | 16 , m_name(name) |
| 17 , m_paintImageGeneratorObserver(new Observer(this)) | 17 , m_paintImageGeneratorObserver(new Observer(this)) |
| 18 { | 18 { |
| 19 } | 19 } |
| 20 | 20 |
| 21 CSSPaintValue::~CSSPaintValue() | 21 CSSPaintValue::~CSSPaintValue() |
| 22 { | 22 { |
| 23 } | 23 } |
| 24 | 24 |
| 25 String CSSPaintValue::customCSSText() const | 25 String CSSPaintValue::customCSSText() const |
| 26 { | 26 { |
| 27 StringBuilder result; | 27 StringBuilder result; |
| 28 result.appendLiteral("paint("); | 28 result.append("paint("); |
| 29 result.append(m_name->customCSSText()); | 29 result.append(m_name->customCSSText()); |
| 30 result.append(')'); | 30 result.append(')'); |
| 31 return result.toString(); | 31 return result.toString(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 String CSSPaintValue::name() const | 34 String CSSPaintValue::name() const |
| 35 { | 35 { |
| 36 return m_name->value(); | 36 return m_name->value(); |
| 37 } | 37 } |
| 38 | 38 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 63 | 63 |
| 64 DEFINE_TRACE_AFTER_DISPATCH(CSSPaintValue) | 64 DEFINE_TRACE_AFTER_DISPATCH(CSSPaintValue) |
| 65 { | 65 { |
| 66 visitor->trace(m_name); | 66 visitor->trace(m_name); |
| 67 visitor->trace(m_generator); | 67 visitor->trace(m_generator); |
| 68 visitor->trace(m_paintImageGeneratorObserver); | 68 visitor->trace(m_paintImageGeneratorObserver); |
| 69 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 69 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace blink | 72 } // namespace blink |
| OLD | NEW |