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()->createAndAppendIfNeeded<BeginComposit
ingDisplayItem>(client, xferMode, opacity, bounds, colorFilter); |
35 } else { | 35 } else { |
36 BeginCompositingDisplayItem beginCompositingDisplayItem(client, xferMode
, opacity, bounds, colorFilter); | 36 BeginCompositingDisplayItem beginCompositingDisplayItem(client, xferMode
, opacity, bounds, colorFilter); |
37 beginCompositingDisplayItem.replay(graphicsContext); | 37 beginCompositingDisplayItem.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()->displayItemConstructionIsDisabled
()) | 45 if (graphicsContext.displayItemList()->displayItemConstructionIsDisabled
()) |
46 return; | 46 return; |
47 graphicsContext.displayItemList()->add(EndCompositingDisplayItem::create
(client)); | 47 graphicsContext.displayItemList()->createAndAppendIfNeeded<EndCompositin
gDisplayItem>(client); |
48 } else { | 48 } else { |
49 EndCompositingDisplayItem endCompositingDisplayItem(client); | 49 EndCompositingDisplayItem endCompositingDisplayItem(client); |
50 endCompositingDisplayItem.replay(graphicsContext); | 50 endCompositingDisplayItem.replay(graphicsContext); |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 } // namespace blink | 54 } // namespace blink |
OLD | NEW |