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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 2490163002: Reland of "Tracking reference filter mutation via SVGElementProxy" (Closed)
Patch Set: Fix double observer unregistration; simplify scope selection; add tests Created 4 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } else { 214 } else {
215 // legacy synchronous context restoration. 215 // legacy synchronous context restoration.
216 reset(); 216 reset();
217 m_contextLostMode = NotLostContext; 217 m_contextLostMode = NotLostContext;
218 } 218 }
219 } 219 }
220 } 220 }
221 221
222 DEFINE_TRACE(CanvasRenderingContext2D) { 222 DEFINE_TRACE(CanvasRenderingContext2D) {
223 visitor->trace(m_hitRegionManager); 223 visitor->trace(m_hitRegionManager);
224 visitor->trace(m_filterOperations);
224 CanvasRenderingContext::trace(visitor); 225 CanvasRenderingContext::trace(visitor);
225 BaseRenderingContext2D::trace(visitor); 226 BaseRenderingContext2D::trace(visitor);
226 SVGResourceClient::trace(visitor); 227 SVGResourceClient::trace(visitor);
227 } 228 }
228 229
229 void CanvasRenderingContext2D::dispatchContextLostEvent(TimerBase*) { 230 void CanvasRenderingContext2D::dispatchContextLostEvent(TimerBase*) {
230 if (canvas() && contextLostRestoredEventsEnabled()) { 231 if (canvas() && contextLostRestoredEventsEnabled()) {
231 Event* event = Event::createCancelable(EventTypeNames::contextlost); 232 Event* event = Event::createCancelable(EventTypeNames::contextlost);
232 canvas()->dispatchEvent(event); 233 canvas()->dispatchEvent(event);
233 if (event->defaultPrevented()) { 234 if (event->defaultPrevented()) {
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 } 559 }
559 } 560 }
560 561
561 void CanvasRenderingContext2D::styleDidChange(const ComputedStyle* oldStyle, 562 void CanvasRenderingContext2D::styleDidChange(const ComputedStyle* oldStyle,
562 const ComputedStyle& newStyle) { 563 const ComputedStyle& newStyle) {
563 if (oldStyle && oldStyle->font() == newStyle.font()) 564 if (oldStyle && oldStyle->font() == newStyle.font())
564 return; 565 return;
565 pruneLocalFontCache(0); 566 pruneLocalFontCache(0);
566 } 567 }
567 568
568 void CanvasRenderingContext2D::filterNeedsInvalidation() { 569 TreeScope* CanvasRenderingContext2D::treeScope() {
570 return &canvas()->treeScope();
571 }
572
573 void CanvasRenderingContext2D::clearFilterReferences() {
574 m_filterOperations.removeClient(this);
575 m_filterOperations.clear();
576 }
577
578 void CanvasRenderingContext2D::updateFilterReferences(
579 const FilterOperations& filters) {
580 clearFilterReferences();
581 filters.addClient(this);
582 m_filterOperations = filters;
583 }
584
585 void CanvasRenderingContext2D::resourceContentChanged() {
586 resourceElementChanged();
587 }
588
589 void CanvasRenderingContext2D::resourceElementChanged() {
590 clearFilterReferences();
569 state().clearResolvedFilter(); 591 state().clearResolvedFilter();
570 } 592 }
571 593
572 bool CanvasRenderingContext2D::originClean() const { 594 bool CanvasRenderingContext2D::originClean() const {
573 return canvas()->originClean(); 595 return canvas()->originClean();
574 } 596 }
575 597
576 void CanvasRenderingContext2D::setOriginTainted() { 598 void CanvasRenderingContext2D::setOriginTainted() {
577 return canvas()->setOriginTainted(); 599 return canvas()->setOriginTainted();
578 } 600 }
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 } 1180 }
1159 return true; 1181 return true;
1160 } 1182 }
1161 1183
1162 void CanvasRenderingContext2D::resetUsageTracking() { 1184 void CanvasRenderingContext2D::resetUsageTracking() {
1163 UsageCounters newCounters; 1185 UsageCounters newCounters;
1164 m_usageCounters = newCounters; 1186 m_usageCounters = newCounters;
1165 } 1187 }
1166 1188
1167 } // namespace blink 1189 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698