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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp

Issue 1387573003: Pass SkiaImageFilterBuilder& to FilterEffect::createImageFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2013 Google Inc. All rights reserved. 7 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 bool FEBlend::setBlendMode(WebBlendMode mode) 51 bool FEBlend::setBlendMode(WebBlendMode mode)
52 { 52 {
53 if (m_mode == mode) 53 if (m_mode == mode)
54 return false; 54 return false;
55 m_mode = mode; 55 m_mode = mode;
56 return true; 56 return true;
57 } 57 }
58 58
59 PassRefPtr<SkImageFilter> FEBlend::createImageFilter(SkiaImageFilterBuilder* bui lder) 59 PassRefPtr<SkImageFilter> FEBlend::createImageFilter(SkiaImageFilterBuilder& bui lder)
60 { 60 {
61 RefPtr<SkImageFilter> foreground(builder->build(inputEffect(0), operatingCol orSpace())); 61 RefPtr<SkImageFilter> foreground(builder.build(inputEffect(0), operatingColo rSpace()));
62 RefPtr<SkImageFilter> background(builder->build(inputEffect(1), operatingCol orSpace())); 62 RefPtr<SkImageFilter> background(builder.build(inputEffect(1), operatingColo rSpace()));
63 RefPtr<SkXfermode> mode(adoptRef(SkXfermode::Create(WebCoreCompositeToSkiaCo mposite(CompositeSourceOver, m_mode)))); 63 RefPtr<SkXfermode> mode(adoptRef(SkXfermode::Create(WebCoreCompositeToSkiaCo mposite(CompositeSourceOver, m_mode))));
64 SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset()); 64 SkImageFilter::CropRect cropRect = getCropRect(builder.cropOffset());
65 return adoptRef(SkXfermodeImageFilter::Create(mode.get(), background.get(), foreground.get(), &cropRect)); 65 return adoptRef(SkXfermodeImageFilter::Create(mode.get(), background.get(), foreground.get(), &cropRect));
66 } 66 }
67 67
68 TextStream& FEBlend::externalRepresentation(TextStream& ts, int indent) const 68 TextStream& FEBlend::externalRepresentation(TextStream& ts, int indent) const
69 { 69 {
70 writeIndent(ts, indent); 70 writeIndent(ts, indent);
71 ts << "[feBlend"; 71 ts << "[feBlend";
72 FilterEffect::externalRepresentation(ts); 72 FilterEffect::externalRepresentation(ts);
73 ts << " mode=\"" << (m_mode == WebBlendModeNormal ? "normal" : compositeOper atorName(CompositeSourceOver, m_mode)) << "\"]\n"; 73 ts << " mode=\"" << (m_mode == WebBlendModeNormal ? "normal" : compositeOper atorName(CompositeSourceOver, m_mode)) << "\"]\n";
74 inputEffect(0)->externalRepresentation(ts, indent + 1); 74 inputEffect(0)->externalRepresentation(ts, indent + 1);
75 inputEffect(1)->externalRepresentation(ts, indent + 1); 75 inputEffect(1)->externalRepresentation(ts, indent + 1);
76 return ts; 76 return ts;
77 } 77 }
78 78
79 } // namespace blink 79 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698