1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 #include "platform/graphics/paint/CompositingDisplayItem.h"
8 #include "platform/RuntimeEnabledFeatures.h"
9 #include "platform/graphics/GraphicsContext.h"
10 #include "platform/graphics/skia/SkiaUtils.h"
11 #include "public/platform/WebDisplayItemList.h"
15 void BeginCompositingDisplayItem::replay(GraphicsContext
& context
)
17 context
.beginLayer(m_opacity
, m_xferMode
, m_hasBounds
? &m_bounds
: nullptr, m_colorFilter
);
20 void BeginCompositingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList
* list
) const
22 SkRect bounds
= m_bounds
;
23 list
->appendCompositingItem(m_opacity
, m_xferMode
, m_hasBounds
? &bounds
: nullptr, GraphicsContext::WebCoreColorFilterToSkiaColorFilter(m_colorFilter
).get());
27 void BeginCompositingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder
& stringBuilder
) const
29 DisplayItem::dumpPropertiesAsDebugString(stringBuilder
);
30 stringBuilder
.append(WTF::String::format(", xferMode: %d, opacity: %f", m_xferMode
, m_opacity
));
32 stringBuilder
.append(WTF::String::format(", bounds: [%f, %f, %f, %f]", m_bounds
.location().x(), m_bounds
.location().y(), m_bounds
.size().width(), m_bounds
.size().height()));
36 void EndCompositingDisplayItem::replay(GraphicsContext
& context
)
41 void EndCompositingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList
* list
) const
43 list
->appendEndCompositingItem();