Commit 371eb5a3 authored by Fernando Serboncini's avatar Fernando Serboncini Committed by Commit Bot

Update Document Style and Layout beforing getting style's filter quality

Bug: 888458
Change-Id: Ib17eff8795d8daaa2e67f3c478f71079a52b9d5a
Reviewed-on: https://chromium-review.googlesource.com/c/1283488Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Fernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602398}
parent e7a1ddfb
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h" #include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/fileapi/file.h" #include "third_party/blink/renderer/core/fileapi/file.h"
#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h"
...@@ -652,9 +653,13 @@ static std::pair<blink::Image*, float> BrokenCanvas(float device_scale_factor) { ...@@ -652,9 +653,13 @@ static std::pair<blink::Image*, float> BrokenCanvas(float device_scale_factor) {
SkFilterQuality HTMLCanvasElement::FilterQuality() const { SkFilterQuality HTMLCanvasElement::FilterQuality() const {
if (!isConnected()) if (!isConnected())
return kLow_SkFilterQuality; return kLow_SkFilterQuality;
HTMLCanvasElement* non_const_this = const_cast<HTMLCanvasElement*>(this);
non_const_this->UpdateDistributionForFlatTreeTraversal(); const ComputedStyle* style = GetComputedStyle();
const ComputedStyle* style = non_const_this->EnsureComputedStyle(); if (!style) {
GetDocument().UpdateStyleAndLayoutTreeForNode(this);
HTMLCanvasElement* non_const_this = const_cast<HTMLCanvasElement*>(this);
style = non_const_this->EnsureComputedStyle();
}
return (style && style->ImageRendering() == EImageRendering::kPixelated) return (style && style->ImageRendering() == EImageRendering::kPixelated)
? kNone_SkFilterQuality ? kNone_SkFilterQuality
: kLow_SkFilterQuality; : kLow_SkFilterQuality;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment