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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index 7614344777eaa2b8807216639c1e271db631d3c7..b138cecd63628bd489ca7cfed0d8ba0c059cd2bc 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -382,6 +382,10 @@ SkImageFilter* CanvasRenderingContext2D::stateGetFilter()
void CanvasRenderingContext2D::snapshotStateForFilter()
{
+ // The style resolution required for fonts is not available in frame-less documents.
+ if (!canvas()->document().frame())
+ return;
+
modifiableState().setFontForFilter(accessFont());
}

Powered by Google App Engine
This is Rietveld 408576698