| 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" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 m_ownerValue->paintImageGeneratorReady(); | 49 m_ownerValue->paintImageGeneratorReady(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void CSSPaintValue::paintImageGeneratorReady() | 52 void CSSPaintValue::paintImageGeneratorReady() |
| 53 { | 53 { |
| 54 for (const LayoutObject* client : clients().keys()) { | 54 for (const LayoutObject* client : clients().keys()) { |
| 55 const_cast<LayoutObject*>(client)->imageChanged(static_cast<WrappedImage
Ptr>(this)); | 55 const_cast<LayoutObject*>(client)->imageChanged(static_cast<WrappedImage
Ptr>(this)); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool CSSPaintValue::knownToBeOpaque(const LayoutObject& layoutObject) const |
| 60 { |
| 61 return m_generator && !m_generator->hasAlpha(); |
| 62 } |
| 63 |
| 59 bool CSSPaintValue::equals(const CSSPaintValue& other) const | 64 bool CSSPaintValue::equals(const CSSPaintValue& other) const |
| 60 { | 65 { |
| 61 return name() == other.name(); | 66 return name() == other.name(); |
| 62 } | 67 } |
| 63 | 68 |
| 64 DEFINE_TRACE_AFTER_DISPATCH(CSSPaintValue) | 69 DEFINE_TRACE_AFTER_DISPATCH(CSSPaintValue) |
| 65 { | 70 { |
| 66 visitor->trace(m_name); | 71 visitor->trace(m_name); |
| 67 visitor->trace(m_generator); | 72 visitor->trace(m_generator); |
| 68 visitor->trace(m_paintImageGeneratorObserver); | 73 visitor->trace(m_paintImageGeneratorObserver); |
| 69 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 74 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
| 70 } | 75 } |
| 71 | 76 |
| 72 } // namespace blink | 77 } // namespace blink |
| OLD | NEW |