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

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 1291673005: Adding a null pointer check in HTMLCanvasElement::didRecalcStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index ba236832342b0382e851b15e55f70a98f2f5e158..bf64bfaa776c67b3da3980abd7df17362504f352 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -142,7 +142,14 @@ LayoutObject* HTMLCanvasElement::createLayoutObject(const ComputedStyle& style)
void HTMLCanvasElement::didRecalcStyle(StyleRecalcChange)
{
- SkFilterQuality filterQuality = ensureComputedStyle()->imageRendering() == ImageRenderingPixelated ? kNone_SkFilterQuality : kLow_SkFilterQuality;
+ SkFilterQuality filterQuality;
+ const ComputedStyle* style = ensureComputedStyle();
+ if (style && style->imageRendering() == ImageRenderingPixelated) {
+ filterQuality = kNone_SkFilterQuality;
+ } else {
+ filterQuality = kLow_SkFilterQuality;
+ }
+
if (is3D()) {
m_context->setFilterQuality(filterQuality);
setNeedsCompositingUpdate();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698