| 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 "modules/csspaint/CSSPaintImageGeneratorImpl.h" | 5 #include "modules/csspaint/CSSPaintImageGeneratorImpl.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/LocalDOMWindow.h" | 8 #include "core/frame/LocalDOMWindow.h" |
| 9 #include "modules/csspaint/CSSPaintDefinition.h" | 9 #include "modules/csspaint/CSSPaintDefinition.h" |
| 10 #include "modules/csspaint/PaintWorklet.h" | 10 #include "modules/csspaint/PaintWorklet.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 void CSSPaintImageGeneratorImpl::setDefinition(CSSPaintDefinition* definition) | 47 void CSSPaintImageGeneratorImpl::setDefinition(CSSPaintDefinition* definition) |
| 48 { | 48 { |
| 49 ASSERT(!m_definition); | 49 ASSERT(!m_definition); |
| 50 m_definition = definition; | 50 m_definition = definition; |
| 51 | 51 |
| 52 ASSERT(m_observer); | 52 ASSERT(m_observer); |
| 53 m_observer->paintImageGeneratorReady(); | 53 m_observer->paintImageGeneratorReady(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 PassRefPtr<Image> CSSPaintImageGeneratorImpl::paint(const LayoutObject& layoutOb
ject, const IntSize& size) | 56 PassRefPtr<Image> CSSPaintImageGeneratorImpl::paint(const LayoutObject& layoutOb
ject, const IntSize& size, float zoom) |
| 57 { | 57 { |
| 58 return m_definition ? m_definition->paint(layoutObject, size) : nullptr; | 58 return m_definition ? m_definition->paint(layoutObject, size, zoom) : nullpt
r; |
| 59 } | 59 } |
| 60 | 60 |
| 61 const Vector<CSSPropertyID>& CSSPaintImageGeneratorImpl::nativeInvalidationPrope
rties() const | 61 const Vector<CSSPropertyID>& CSSPaintImageGeneratorImpl::nativeInvalidationPrope
rties() const |
| 62 { | 62 { |
| 63 DEFINE_STATIC_LOCAL(Vector<CSSPropertyID>, emptyVector, ()); | 63 DEFINE_STATIC_LOCAL(Vector<CSSPropertyID>, emptyVector, ()); |
| 64 return m_definition ? m_definition->nativeInvalidationProperties() : emptyVe
ctor; | 64 return m_definition ? m_definition->nativeInvalidationProperties() : emptyVe
ctor; |
| 65 } | 65 } |
| 66 | 66 |
| 67 const Vector<AtomicString>& CSSPaintImageGeneratorImpl::customInvalidationProper
ties() const | 67 const Vector<AtomicString>& CSSPaintImageGeneratorImpl::customInvalidationProper
ties() const |
| 68 { | 68 { |
| 69 DEFINE_STATIC_LOCAL(Vector<AtomicString>, emptyVector, ()); | 69 DEFINE_STATIC_LOCAL(Vector<AtomicString>, emptyVector, ()); |
| 70 return m_definition ? m_definition->customInvalidationProperties() : emptyVe
ctor; | 70 return m_definition ? m_definition->customInvalidationProperties() : emptyVe
ctor; |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool CSSPaintImageGeneratorImpl::hasAlpha() const | 73 bool CSSPaintImageGeneratorImpl::hasAlpha() const |
| 74 { | 74 { |
| 75 return m_definition && m_definition->hasAlpha(); | 75 return m_definition && m_definition->hasAlpha(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 DEFINE_TRACE(CSSPaintImageGeneratorImpl) | 78 DEFINE_TRACE(CSSPaintImageGeneratorImpl) |
| 79 { | 79 { |
| 80 visitor->trace(m_definition); | 80 visitor->trace(m_definition); |
| 81 visitor->trace(m_observer); | 81 visitor->trace(m_observer); |
| 82 CSSPaintImageGenerator::trace(visitor); | 82 CSSPaintImageGenerator::trace(visitor); |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace blink | 85 } // namespace blink |
| OLD | NEW |