| 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 "core/paint/CompositingRecorder.h" | 6 #include "core/paint/CompositingRecorder.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutObject.h" | 8 #include "core/layout/LayoutObject.h" |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 #include "platform/graphics/GraphicsLayer.h" | 10 #include "platform/graphics/GraphicsLayer.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 { | 24 { |
| 25 endCompositing(m_graphicsContext, m_client); | 25 endCompositing(m_graphicsContext, m_client); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void CompositingRecorder::beginCompositing(GraphicsContext& graphicsContext, con
st DisplayItemClientWrapper& client, const SkXfermode::Mode xferMode, const floa
t opacity, const FloatRect* bounds, ColorFilter colorFilter) | 28 void CompositingRecorder::beginCompositing(GraphicsContext& graphicsContext, con
st DisplayItemClientWrapper& client, const SkXfermode::Mode xferMode, const floa
t opacity, const FloatRect* bounds, ColorFilter colorFilter) |
| 29 { | 29 { |
| 30 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 30 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 31 ASSERT(graphicsContext.displayItemList()); | 31 ASSERT(graphicsContext.displayItemList()); |
| 32 if (graphicsContext.displayItemList()->displayItemConstructionIsDisabled
()) | 32 if (graphicsContext.displayItemList()->displayItemConstructionIsDisabled
()) |
| 33 return; | 33 return; |
| 34 graphicsContext.displayItemList()->add(BeginCompositingDisplayItem::crea
te(client, xferMode, opacity, bounds, colorFilter)); | 34 graphicsContext.displayItemList()->createAndAppend<BeginCompositingDispl
ayItem>(client, xferMode, opacity, bounds, colorFilter); |
| 35 } else { | 35 } else { |
| 36 BeginCompositingDisplayItem beginCompositingDisplayItem(client, xferMode
, opacity, bounds, colorFilter); | 36 BeginCompositingDisplayItem compositingDisplayItem(client, xferMode, opa
city, bounds, colorFilter); |
| 37 beginCompositingDisplayItem.replay(graphicsContext); | 37 compositingDisplayItem.replay(graphicsContext); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 void CompositingRecorder::endCompositing(GraphicsContext& graphicsContext, const
DisplayItemClientWrapper& client) | 41 void CompositingRecorder::endCompositing(GraphicsContext& graphicsContext, const
DisplayItemClientWrapper& client) |
| 42 { | 42 { |
| 43 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 43 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 44 ASSERT(graphicsContext.displayItemList()); | 44 ASSERT(graphicsContext.displayItemList()); |
| 45 if (!graphicsContext.displayItemList()->displayItemConstructionIsDisable
d()) { | 45 if (!graphicsContext.displayItemList()->displayItemConstructionIsDisable
d()) { |
| 46 if (graphicsContext.displayItemList()->lastDisplayItemIsNoopBegin()) | 46 if (graphicsContext.displayItemList()->lastDisplayItemIsNoopBegin()) |
| 47 graphicsContext.displayItemList()->removeLastDisplayItem(); | 47 graphicsContext.displayItemList()->removeLastDisplayItem(); |
| 48 else | 48 else |
| 49 graphicsContext.displayItemList()->add(EndCompositingDisplayItem
::create(client)); | 49 graphicsContext.displayItemList()->createAndAppend<EndCompositin
gDisplayItem>(client); |
| 50 } | 50 } |
| 51 } else { | 51 } else { |
| 52 EndCompositingDisplayItem endCompositingDisplayItem(client); | 52 EndCompositingDisplayItem endCompositingDisplayItem(client); |
| 53 endCompositingDisplayItem.replay(graphicsContext); | 53 endCompositingDisplayItem.replay(graphicsContext); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace blink | 57 } // namespace blink |
| OLD | NEW |