| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "platform/graphics/paint/CompositingDisplayItem.h" | 5 #include "platform/graphics/paint/CompositingDisplayItem.h" |
| 6 | 6 |
| 7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
| 8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
| 9 #include "platform/graphics/skia/SkiaUtils.h" | 9 #include "platform/graphics/skia/SkiaUtils.h" |
| 10 #include "public/platform/WebDisplayItemList.h" | 10 #include "public/platform/WebDisplayItemList.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 void BeginCompositingDisplayItem::replay(GraphicsContext& context) const | 14 void BeginCompositingDisplayItem::replay(GraphicsContext& context) const |
| 15 { | 15 { |
| 16 context.beginLayer(m_opacity, m_xferMode, m_hasBounds ? &m_bounds : nullptr,
m_colorFilter); | 16 context.beginLayer(m_opacity, m_xferMode, m_hasBounds ? &m_bounds : nullptr,
m_colorFilter); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void BeginCompositingDisplayItem::appendToWebDisplayItemList(const IntRect& visu
alRect, WebDisplayItemList* list) const | 19 void BeginCompositingDisplayItem::appendToWebDisplayItemList(const IntRect& visu
alRect, WebDisplayItemList* list) const |
| 20 { | 20 { |
| 21 SkRect bounds = m_bounds; | 21 SkRect bounds = m_bounds; |
| 22 list->appendCompositingItem(visualRect, m_opacity, m_xferMode, | 22 list->appendCompositingItem(m_opacity, m_xferMode, |
| 23 m_hasBounds ? &bounds : nullptr, | 23 m_hasBounds ? &bounds : nullptr, |
| 24 GraphicsContext::WebCoreColorFilterToSkiaColorFilter(m_colorFilter).get(
)); | 24 GraphicsContext::WebCoreColorFilterToSkiaColorFilter(m_colorFilter).get(
)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 #ifndef NDEBUG | 27 #ifndef NDEBUG |
| 28 void BeginCompositingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder
& stringBuilder) const | 28 void BeginCompositingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder
& stringBuilder) const |
| 29 { | 29 { |
| 30 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); | 30 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); |
| 31 stringBuilder.append(WTF::String::format(", xferMode: %d, opacity: %f", m_xf
erMode, m_opacity)); | 31 stringBuilder.append(WTF::String::format(", xferMode: %d, opacity: %f", m_xf
erMode, m_opacity)); |
| 32 if (m_hasBounds) | 32 if (m_hasBounds) |
| 33 stringBuilder.append(WTF::String::format(", bounds: [%f, %f, %f, %f]", m
_bounds.location().x(), m_bounds.location().y(), m_bounds.size().width(), m_boun
ds.size().height())); | 33 stringBuilder.append(WTF::String::format(", bounds: [%f, %f, %f, %f]", m
_bounds.location().x(), m_bounds.location().y(), m_bounds.size().width(), m_boun
ds.size().height())); |
| 34 } | 34 } |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 void EndCompositingDisplayItem::replay(GraphicsContext& context) const | 37 void EndCompositingDisplayItem::replay(GraphicsContext& context) const |
| 38 { | 38 { |
| 39 context.endLayer(); | 39 context.endLayer(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void EndCompositingDisplayItem::appendToWebDisplayItemList(const IntRect& visual
Rect, WebDisplayItemList* list) const | 42 void EndCompositingDisplayItem::appendToWebDisplayItemList(const IntRect& visual
Rect, WebDisplayItemList* list) const |
| 43 { | 43 { |
| 44 list->appendEndCompositingItem(visualRect); | 44 list->appendEndCompositingItem(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace blink | 47 } // namespace blink |
| OLD | NEW |