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/FilterPainter.h" | 6 #include "core/paint/FilterPainter.h" |
7 | 7 |
8 #include "core/paint/LayerClipRecorder.h" | 8 #include "core/paint/LayerClipRecorder.h" |
9 #include "core/paint/LayerPainter.h" | 9 #include "core/paint/LayerPainter.h" |
10 #include "core/rendering/FilterEffectRenderer.h" | 10 #include "core/rendering/FilterEffectRenderer.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // Subsequent code should not clip to the dirty rect, since we've already | 50 // Subsequent code should not clip to the dirty rect, since we've already |
51 // done it above, and doing it later will defeat the outsets. | 51 // done it above, and doing it later will defeat the outsets. |
52 paintingInfo.clipToDirtyRect = false; | 52 paintingInfo.clipToDirtyRect = false; |
53 | 53 |
54 if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius())
{ | 54 if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius())
{ |
55 m_clipRecorder = adoptPtr(new LayerClipRecorder(renderLayer.renderer(),
context, DisplayItem::ClipLayerFilter, clipRect, &paintingInfo, LayoutPoint(), p
aintFlags)); | 55 m_clipRecorder = adoptPtr(new LayerClipRecorder(renderLayer.renderer(),
context, DisplayItem::ClipLayerFilter, clipRect, &paintingInfo, LayoutPoint(), p
aintFlags)); |
56 } | 56 } |
57 | 57 |
58 ASSERT(m_renderer); | 58 ASSERT(m_renderer); |
59 OwnPtr<FilterOperations> filterOperations; | |
60 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 59 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
61 // FIXME: verify whether this FilterOperations object and the ImageFilte
r object constructed above represent the same effect. | 60 // FIXME: verify whether this FilterOperations object and the ImageFilte
r object constructed above represent the same effect. |
62 filterOperations = adoptPtr(new FilterOperations(renderLayer.computeFilt
erOperations(m_renderer->style()))); | 61 FilterOperations filterOperations(renderLayer.computeFilterOperations(m_
renderer->style())); |
63 } | 62 OwnPtr<BeginFilterDisplayItem> filterDisplayItem = BeginFilterDisplayIte
m::create(m_renderer->displayItemClient(), DisplayItem::BeginFilter, imageFilter
, rootRelativeBounds, filterOperations); |
64 OwnPtr<BeginFilterDisplayItem> filterDisplayItem = BeginFilterDisplayItem::c
reate(m_renderer->displayItemClient(), DisplayItem::BeginFilter, imageFilter, fi
lterOperations.get(), rootRelativeBounds); | 63 |
65 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | |
66 ASSERT(context->displayItemList()); | 64 ASSERT(context->displayItemList()); |
67 context->displayItemList()->add(filterDisplayItem.release()); | 65 context->displayItemList()->add(filterDisplayItem.release()); |
68 } else { | 66 } else { |
| 67 OwnPtr<BeginFilterDisplayItem> filterDisplayItem = BeginFilterDisplayIte
m::create(m_renderer->displayItemClient(), DisplayItem::BeginFilter, imageFilter
, rootRelativeBounds); |
| 68 |
69 filterDisplayItem->replay(context); | 69 filterDisplayItem->replay(context); |
70 } | 70 } |
71 | 71 |
72 m_filterInProgress = true; | 72 m_filterInProgress = true; |
73 } | 73 } |
74 | 74 |
75 FilterPainter::~FilterPainter() | 75 FilterPainter::~FilterPainter() |
76 { | 76 { |
77 if (!m_filterInProgress) | 77 if (!m_filterInProgress) |
78 return; | 78 return; |
79 | 79 |
80 OwnPtr<EndFilterDisplayItem> endFilterDisplayItem = EndFilterDisplayItem::cr
eate(m_renderer->displayItemClient()); | 80 OwnPtr<EndFilterDisplayItem> endFilterDisplayItem = EndFilterDisplayItem::cr
eate(m_renderer->displayItemClient()); |
81 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 81 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
82 ASSERT(m_context->displayItemList()); | 82 ASSERT(m_context->displayItemList()); |
83 m_context->displayItemList()->add(endFilterDisplayItem.release()); | 83 m_context->displayItemList()->add(endFilterDisplayItem.release()); |
84 } else { | 84 } else { |
85 endFilterDisplayItem->replay(m_context); | 85 endFilterDisplayItem->replay(m_context); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 } // namespace blink | 89 } // namespace blink |
OLD | NEW |