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

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

Issue 1903613002: Skip canvas filter construction in frameless documents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment Created 4 years, 8 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 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 return state().hasFilter(canvas(), canvas()->size(), this); 375 return state().hasFilter(canvas(), canvas()->size(), this);
376 } 376 }
377 377
378 SkImageFilter* CanvasRenderingContext2D::stateGetFilter() 378 SkImageFilter* CanvasRenderingContext2D::stateGetFilter()
379 { 379 {
380 return state().getFilter(canvas(), canvas()->size(), this); 380 return state().getFilter(canvas(), canvas()->size(), this);
381 } 381 }
382 382
383 void CanvasRenderingContext2D::snapshotStateForFilter() 383 void CanvasRenderingContext2D::snapshotStateForFilter()
384 { 384 {
385 // The style resolution required for fonts is not available in frame-less do cuments.
386 if (!canvas()->document().frame())
387 return;
388
385 modifiableState().setFontForFilter(accessFont()); 389 modifiableState().setFontForFilter(accessFont());
386 } 390 }
387 391
388 SkCanvas* CanvasRenderingContext2D::drawingCanvas() const 392 SkCanvas* CanvasRenderingContext2D::drawingCanvas() const
389 { 393 {
390 if (isContextLost()) 394 if (isContextLost())
391 return nullptr; 395 return nullptr;
392 return canvas()->drawingCanvas(); 396 return canvas()->drawingCanvas();
393 } 397 }
394 398
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 1055
1052 unsigned CanvasRenderingContext2D::hitRegionsCount() const 1056 unsigned CanvasRenderingContext2D::hitRegionsCount() const
1053 { 1057 {
1054 if (m_hitRegionManager) 1058 if (m_hitRegionManager)
1055 return m_hitRegionManager->getHitRegionsCount(); 1059 return m_hitRegionManager->getHitRegionsCount();
1056 1060
1057 return 0; 1061 return 0;
1058 } 1062 }
1059 1063
1060 } // namespace blink 1064 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698