Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: Source/platform/graphics/paint/FilterDisplayItem.cpp

Issue 880203006: Oilpan: fix build after r189148. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tidy up call site a bit further Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/paint/FilterDisplayItem.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/FilterDisplayItem.h" 6 #include "platform/graphics/paint/FilterDisplayItem.h"
7 7
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" 9 #include "platform/graphics/filters/SkiaImageFilterBuilder.h"
10 #include "public/platform/Platform.h" 10 #include "public/platform/Platform.h"
11 #include "public/platform/WebCompositorSupport.h" 11 #include "public/platform/WebCompositorSupport.h"
12 #include "public/platform/WebDisplayItemList.h" 12 #include "public/platform/WebDisplayItemList.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 BeginFilterDisplayItem::BeginFilterDisplayItem(DisplayItemClient client, Type ty pe, PassRefPtr<ImageFilter> imageFilter, const FilterOperations* filterOperation s, const LayoutRect& bounds) 16 BeginFilterDisplayItem::BeginFilterDisplayItem(DisplayItemClient client, Type ty pe, PassRefPtr<ImageFilter> imageFilter, const LayoutRect& bounds)
17 : DisplayItem(client, type) 17 : DisplayItem(client, type)
18 , m_imageFilter(imageFilter) 18 , m_imageFilter(imageFilter)
19 , m_bounds(bounds) 19 , m_bounds(bounds)
20 { 20 {
21 if (filterOperations) { 21 }
22 SkiaImageFilterBuilder builder; 22
23 m_webFilterOperations = adoptPtr(Platform::current()->compositorSupport( )->createFilterOperations()); 23 BeginFilterDisplayItem::BeginFilterDisplayItem(DisplayItemClient client, Type ty pe, PassRefPtr<ImageFilter> imageFilter, const LayoutRect& bounds, const FilterO perations& filterOperations)
24 FilterOutsets outsets = filterOperations->outsets(); 24 : DisplayItem(client, type)
25 builder.setCropOffset(FloatSize(outsets.left(), outsets.top())); 25 , m_imageFilter(imageFilter)
26 builder.buildFilterOperations(*filterOperations, m_webFilterOperations.g et()); 26 , m_bounds(bounds)
27 } 27 {
28 SkiaImageFilterBuilder builder;
29 m_webFilterOperations = adoptPtr(Platform::current()->compositorSupport()->c reateFilterOperations());
30 FilterOutsets outsets = filterOperations.outsets();
31 builder.setCropOffset(FloatSize(outsets.left(), outsets.top()));
32 builder.buildFilterOperations(filterOperations, m_webFilterOperations.get()) ;
28 } 33 }
29 34
30 void BeginFilterDisplayItem::replay(GraphicsContext* context) 35 void BeginFilterDisplayItem::replay(GraphicsContext* context)
31 { 36 {
32 context->save(); 37 context->save();
33 FloatRect boundaries = mapImageFilterRect(m_imageFilter.get(), m_bounds); 38 FloatRect boundaries = mapImageFilterRect(m_imageFilter.get(), m_bounds);
34 context->translate(m_bounds.x().toFloat(), m_bounds.y().toFloat()); 39 context->translate(m_bounds.x().toFloat(), m_bounds.y().toFloat());
35 boundaries.move(-m_bounds.x().toFloat(), -m_bounds.y().toFloat()); 40 boundaries.move(-m_bounds.x().toFloat(), -m_bounds.y().toFloat());
36 context->beginLayer(1, SkXfermode::kSrcOver_Mode, &boundaries, ColorFilterNo ne, m_imageFilter.get()); 41 context->beginLayer(1, SkXfermode::kSrcOver_Mode, &boundaries, ColorFilterNo ne, m_imageFilter.get());
37 context->translate(-m_bounds.x().toFloat(), -m_bounds.y().toFloat()); 42 context->translate(-m_bounds.x().toFloat(), -m_bounds.y().toFloat());
(...skipping 18 matching lines...) Expand all
56 context->endLayer(); 61 context->endLayer();
57 context->restore(); 62 context->restore();
58 } 63 }
59 64
60 void EndFilterDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list) const 65 void EndFilterDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list) const
61 { 66 {
62 list->appendEndFilterItem(); 67 list->appendEndFilterItem();
63 } 68 }
64 69
65 } // namespace blink 70 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/FilterDisplayItem.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698