| 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 "config.h" | 5 #include "config.h" |
| 6 #include "platform/graphics/paint/CompositingDisplayItem.h" | 6 #include "platform/graphics/paint/CompositingDisplayItem.h" |
| 7 | 7 |
| 8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 #include "platform/graphics/skia/SkiaUtils.h" | 10 #include "platform/graphics/skia/SkiaUtils.h" |
| 11 #include "public/platform/WebDisplayItemList.h" | 11 #include "public/platform/WebDisplayItemList.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 void BeginCompositingDisplayItem::replay(GraphicsContext* context) | 15 void BeginCompositingDisplayItem::replay(GraphicsContext* context) |
| 16 { | 16 { |
| 17 context->setCompositeOperation(m_preCompositeOp, m_preBlendMode); | 17 context->setCompositeOperation(WebCoreCompositeToSkiaComposite(m_preComposit
eOp, m_preBlendMode)); |
| 18 context->beginLayer(m_opacity, WebCoreCompositeToSkiaComposite(m_preComposit
eOp, m_preBlendMode)); | 18 context->beginLayer(m_opacity, WebCoreCompositeToSkiaComposite(m_preComposit
eOp, m_preBlendMode)); |
| 19 context->setCompositeOperation(m_postCompositeOp, WebBlendModeNormal); | 19 context->setCompositeOperation(WebCoreCompositeToSkiaComposite(m_postComposi
teOp, WebBlendModeNormal)); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void BeginCompositingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList*
list) const | 22 void BeginCompositingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList*
list) const |
| 23 { | 23 { |
| 24 // FIXME: Change this to appendCompositingItem. | 24 // FIXME: Change this to appendCompositingItem. |
| 25 list->appendTransparencyItem(m_opacity, m_preBlendMode); | 25 list->appendTransparencyItem(m_opacity, m_preBlendMode); |
| 26 } | 26 } |
| 27 | 27 |
| 28 #ifndef NDEBUG | 28 #ifndef NDEBUG |
| 29 void BeginCompositingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder
& stringBuilder) const | 29 void BeginCompositingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder
& stringBuilder) const |
| 30 { | 30 { |
| 31 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); | 31 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); |
| 32 stringBuilder.append(WTF::String::format(", preCompositingOp: %d, preBlendMo
de: %d, opacity: %f, postCompositingOp: %d", m_preCompositeOp, m_preBlendMode, m
_opacity, m_postCompositeOp)); | 32 stringBuilder.append(WTF::String::format(", preCompositingOp: %d, preBlendMo
de: %d, opacity: %f, postCompositingOp: %d", m_preCompositeOp, m_preBlendMode, m
_opacity, m_postCompositeOp)); |
| 33 } | 33 } |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 void EndCompositingDisplayItem::replay(GraphicsContext* context) | 36 void EndCompositingDisplayItem::replay(GraphicsContext* context) |
| 37 { | 37 { |
| 38 context->endLayer(); | 38 context->endLayer(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void EndCompositingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* l
ist) const | 41 void EndCompositingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* l
ist) const |
| 42 { | 42 { |
| 43 // FIXME: Change this to appendEndCompositingItem. | 43 // FIXME: Change this to appendEndCompositingItem. |
| 44 list->appendEndTransparencyItem(); | 44 list->appendEndTransparencyItem(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace blink | 47 } // namespace blink |
| OLD | NEW |