| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 ASSERT(!definition_); | 45 ASSERT(!definition_); |
| 46 definition_ = definition; | 46 definition_ = definition; |
| 47 | 47 |
| 48 ASSERT(observer_); | 48 ASSERT(observer_); |
| 49 observer_->PaintImageGeneratorReady(); | 49 observer_->PaintImageGeneratorReady(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 PassRefPtr<Image> CSSPaintImageGeneratorImpl::Paint( | 52 PassRefPtr<Image> CSSPaintImageGeneratorImpl::Paint( |
| 53 const LayoutObject& layout_object, | 53 const LayoutObject& layout_object, |
| 54 const IntSize& size, | 54 const IntSize& size, |
| 55 float zoom, | |
| 56 const CSSStyleValueVector* data) { | 55 const CSSStyleValueVector* data) { |
| 57 return definition_ ? definition_->Paint(layout_object, size, zoom, data) | 56 return definition_ ? definition_->Paint(layout_object, size, data) : nullptr; |
| 58 : nullptr; | |
| 59 } | 57 } |
| 60 | 58 |
| 61 const Vector<CSSPropertyID>& | 59 const Vector<CSSPropertyID>& |
| 62 CSSPaintImageGeneratorImpl::NativeInvalidationProperties() const { | 60 CSSPaintImageGeneratorImpl::NativeInvalidationProperties() const { |
| 63 DEFINE_STATIC_LOCAL(Vector<CSSPropertyID>, empty_vector, ()); | 61 DEFINE_STATIC_LOCAL(Vector<CSSPropertyID>, empty_vector, ()); |
| 64 return definition_ ? definition_->NativeInvalidationProperties() | 62 return definition_ ? definition_->NativeInvalidationProperties() |
| 65 : empty_vector; | 63 : empty_vector; |
| 66 } | 64 } |
| 67 | 65 |
| 68 const Vector<AtomicString>& | 66 const Vector<AtomicString>& |
| (...skipping 17 matching lines...) Expand all Loading... |
| 86 return definition_; | 84 return definition_; |
| 87 } | 85 } |
| 88 | 86 |
| 89 DEFINE_TRACE(CSSPaintImageGeneratorImpl) { | 87 DEFINE_TRACE(CSSPaintImageGeneratorImpl) { |
| 90 visitor->Trace(definition_); | 88 visitor->Trace(definition_); |
| 91 visitor->Trace(observer_); | 89 visitor->Trace(observer_); |
| 92 CSSPaintImageGenerator::Trace(visitor); | 90 CSSPaintImageGenerator::Trace(visitor); |
| 93 } | 91 } |
| 94 | 92 |
| 95 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |