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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPaintValue.cpp

Issue 2077413005: Add "alpha" option to PaintWorklet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set alpha to be true by default Created 4 years, 5 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/CSSPaintValue.h" 5 #include "core/css/CSSPaintValue.h"
6 6
7 #include "core/css/CSSCustomIdentValue.h" 7 #include "core/css/CSSCustomIdentValue.h"
8 #include "core/layout/LayoutObject.h" 8 #include "core/layout/LayoutObject.h"
9 #include "platform/graphics/Image.h" 9 #include "platform/graphics/Image.h"
10 #include "wtf/text/StringBuilder.h" 10 #include "wtf/text/StringBuilder.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 m_ownerValue->paintImageGeneratorReady(); 49 m_ownerValue->paintImageGeneratorReady();
50 } 50 }
51 51
52 void CSSPaintValue::paintImageGeneratorReady() 52 void CSSPaintValue::paintImageGeneratorReady()
53 { 53 {
54 for (const LayoutObject* client : clients().keys()) { 54 for (const LayoutObject* client : clients().keys()) {
55 const_cast<LayoutObject*>(client)->imageChanged(static_cast<WrappedImage Ptr>(this)); 55 const_cast<LayoutObject*>(client)->imageChanged(static_cast<WrappedImage Ptr>(this));
56 } 56 }
57 } 57 }
58 58
59 bool CSSPaintValue::knownToBeOpaque(const LayoutObject& layoutObject) const
60 {
61 return m_generator && !m_generator->hasAlpha();
62 }
63
59 bool CSSPaintValue::equals(const CSSPaintValue& other) const 64 bool CSSPaintValue::equals(const CSSPaintValue& other) const
60 { 65 {
61 return name() == other.name(); 66 return name() == other.name();
62 } 67 }
63 68
64 DEFINE_TRACE_AFTER_DISPATCH(CSSPaintValue) 69 DEFINE_TRACE_AFTER_DISPATCH(CSSPaintValue)
65 { 70 {
66 visitor->trace(m_name); 71 visitor->trace(m_name);
67 visitor->trace(m_generator); 72 visitor->trace(m_generator);
68 visitor->trace(m_paintImageGeneratorObserver); 73 visitor->trace(m_paintImageGeneratorObserver);
69 CSSImageGeneratorValue::traceAfterDispatch(visitor); 74 CSSImageGeneratorValue::traceAfterDispatch(visitor);
70 } 75 }
71 76
72 } // namespace blink 77 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPaintValue.h ('k') | third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698