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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResolverState.h

Issue 2326633002: Adds filter support for offscreen canvas (Closed)
Patch Set: Working version of filters on offscreen canvas Created 4 years, 3 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/core/css/resolver/StyleResolverState.h
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h
index 912098578eab311099bae194f3156b6e491747f2..6e0304667d769afbbc740d973709620b5f354937 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h
@@ -47,12 +47,14 @@ class CORE_EXPORT StyleResolverState {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(StyleResolverState);
public:
+ StyleResolverState(const ComputedStyle* parentStyle);
StyleResolverState(Document&, const ElementResolveContext&, const ComputedStyle* parentStyle);
StyleResolverState(Document&, Element*, const ComputedStyle* parentStyle = 0);
~StyleResolverState();
// In FontFaceSet and CanvasRenderingContext2D, we don't have an element to grab the document from.
// This is why we have to store the document separately.
+ bool hasDocument() const { return m_document; }
Document& document() const { return *m_document; }
// These are all just pass-through methods to ElementResolveContext.
Element* element() const { return m_elementContext.element(); }
@@ -67,7 +69,11 @@ public:
{
// FIXME: Improve RAII of StyleResolverState to remove this function.
m_style = style;
- m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), rootElementStyle(), document().layoutViewItem(), m_style->effectiveZoom());
+ if (m_document) {
+ m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), rootElementStyle(), document().layoutViewItem(), m_style->effectiveZoom());
+ } else {
+ m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), m_style->effectiveZoom());
+ }
}
const ComputedStyle* style() const { return m_style.get(); }
ComputedStyle* style() { return m_style.get(); }

Powered by Google App Engine
This is Rietveld 408576698