Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: third_party/WebKit/Source/modules/csspaint/CSSPaintImageGeneratorImpl.cpp

Issue 2896773002: [DONT COMMIT] PaintWorklet: Move paintWorklet from 'window' to 'CSS' (Closed)
Patch Set: WIP Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/CSSPaintWorklet.h"
10 #include "modules/csspaint/PaintWorklet.h" 11 #include "modules/csspaint/PaintWorklet.h"
11 #include "modules/csspaint/WindowPaintWorklet.h"
12 #include "platform/graphics/Image.h" 12 #include "platform/graphics/Image.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 CSSPaintImageGenerator* CSSPaintImageGeneratorImpl::Create(const String& name, 16 CSSPaintImageGenerator* CSSPaintImageGeneratorImpl::Create(const String& name,
17 Document& document, 17 Document& document,
18 Observer* observer) { 18 Observer* observer) {
19 LocalDOMWindow* dom_window = document.domWindow(); 19 PaintWorklet* paint_worklet = CSSPaintWorklet::paintWorklet(document);
20 PaintWorklet* paint_worklet =
21 WindowPaintWorklet::From(*dom_window).paintWorklet();
22 20
23 CSSPaintDefinition* paint_definition = paint_worklet->FindDefinition(name); 21 CSSPaintDefinition* paint_definition = paint_worklet->FindDefinition(name);
24 CSSPaintImageGeneratorImpl* generator; 22 CSSPaintImageGeneratorImpl* generator;
25 if (!paint_definition) { 23 if (!paint_definition) {
26 generator = new CSSPaintImageGeneratorImpl(observer); 24 generator = new CSSPaintImageGeneratorImpl(observer);
27 paint_worklet->AddPendingGenerator(name, generator); 25 paint_worklet->AddPendingGenerator(name, generator);
28 } else { 26 } else {
29 generator = new CSSPaintImageGeneratorImpl(paint_definition); 27 generator = new CSSPaintImageGeneratorImpl(paint_definition);
30 } 28 }
31 29
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return definition_; 82 return definition_;
85 } 83 }
86 84
87 DEFINE_TRACE(CSSPaintImageGeneratorImpl) { 85 DEFINE_TRACE(CSSPaintImageGeneratorImpl) {
88 visitor->Trace(definition_); 86 visitor->Trace(definition_);
89 visitor->Trace(observer_); 87 visitor->Trace(observer_);
90 CSSPaintImageGenerator::Trace(visitor); 88 CSSPaintImageGenerator::Trace(visitor);
91 } 89 }
92 90
93 } // namespace blink 91 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698