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/FilterDisplayItem.h" | 5 #include "platform/graphics/paint/FilterDisplayItem.h" |
6 | 6 |
7 #include "platform/graphics/GraphicsContext.h" | 7 #include "platform/graphics/GraphicsContext.h" |
8 #include "public/platform/WebDisplayItemList.h" | 8 #include "public/platform/WebDisplayItemList.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 void BeginFilterDisplayItem::replay(GraphicsContext& context) const | 12 void BeginFilterDisplayItem::replay(GraphicsContext& context) const |
13 { | 13 { |
14 FloatRect imageFilterBounds(FloatPoint(), m_bounds.size()); | 14 FloatRect imageFilterBounds(FloatPoint(), m_bounds.size()); |
15 context.save(); | 15 context.save(); |
16 context.translate(m_bounds.x(), m_bounds.y()); | 16 context.translate(m_bounds.x(), m_bounds.y()); |
17 context.beginLayer(1, SkXfermode::kSrcOver_Mode, &imageFilterBounds, ColorFi
lterNone, m_imageFilter.get()); | 17 context.beginLayer(1, SkXfermode::kSrcOver_Mode, &imageFilterBounds, ColorFi
lterNone, m_imageFilter.get()); |
18 context.translate(-m_bounds.x(), -m_bounds.y()); | 18 context.translate(-m_bounds.x(), -m_bounds.y()); |
19 } | 19 } |
20 | 20 |
21 void BeginFilterDisplayItem::appendToWebDisplayItemList(const IntRect& visualRec
t, WebDisplayItemList* list) const | 21 void BeginFilterDisplayItem::appendToWebDisplayItemList(const IntRect& visualRec
t, WebDisplayItemList* list) const |
22 { | 22 { |
23 list->appendFilterItem(visualRect, *m_webFilterOperations, m_bounds); | 23 list->appendFilterItem(visualRect, m_webFilterOperations->asFilterOperations
(), m_bounds); |
24 } | 24 } |
25 | 25 |
26 bool BeginFilterDisplayItem::drawsContent() const | 26 bool BeginFilterDisplayItem::drawsContent() const |
27 { | 27 { |
28 // Skia cannot currently tell us if a filter will draw content, | 28 // Skia cannot currently tell us if a filter will draw content, |
29 // even when no input primitives are drawn. | 29 // even when no input primitives are drawn. |
30 return true; | 30 return true; |
31 } | 31 } |
32 | 32 |
33 #ifndef NDEBUG | 33 #ifndef NDEBUG |
(...skipping 10 matching lines...) Expand all Loading... |
44 context.endLayer(); | 44 context.endLayer(); |
45 context.restore(); | 45 context.restore(); |
46 } | 46 } |
47 | 47 |
48 void EndFilterDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect,
WebDisplayItemList* list) const | 48 void EndFilterDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect,
WebDisplayItemList* list) const |
49 { | 49 { |
50 list->appendEndFilterItem(visualRect); | 50 list->appendEndFilterItem(visualRect); |
51 } | 51 } |
52 | 52 |
53 } // namespace blink | 53 } // namespace blink |
OLD | NEW |