OLD | NEW |
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) 2013 Google Inc. All rights reserved. | 6 * Copyright (C) 2013 Google Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 bool FEFlood::setFloodOpacity(float floodOpacity) | 65 bool FEFlood::setFloodOpacity(float floodOpacity) |
66 { | 66 { |
67 if (m_floodOpacity == floodOpacity) | 67 if (m_floodOpacity == floodOpacity) |
68 return false; | 68 return false; |
69 m_floodOpacity = floodOpacity; | 69 m_floodOpacity = floodOpacity; |
70 return true; | 70 return true; |
71 } | 71 } |
72 | 72 |
73 PassRefPtr<SkImageFilter> FEFlood::createImageFilter(SkiaImageFilterBuilder* bui
lder) | 73 PassRefPtr<SkImageFilter> FEFlood::createImageFilter(SkiaImageFilterBuilder& bui
lder) |
74 { | 74 { |
75 Color color = floodColor().combineWithAlpha(floodOpacity()); | 75 Color color = floodColor().combineWithAlpha(floodOpacity()); |
76 | 76 |
77 SkImageFilter::CropRect rect = getCropRect(builder->cropOffset()); | 77 SkImageFilter::CropRect rect = getCropRect(builder.cropOffset()); |
78 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(color.rgb(),
SkXfermode::kSrc_Mode)); | 78 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(color.rgb(),
SkXfermode::kSrc_Mode)); |
79 return adoptRef(SkColorFilterImageFilter::Create(cf, 0, &rect)); | 79 return adoptRef(SkColorFilterImageFilter::Create(cf, 0, &rect)); |
80 } | 80 } |
81 | 81 |
82 TextStream& FEFlood::externalRepresentation(TextStream& ts, int indent) const | 82 TextStream& FEFlood::externalRepresentation(TextStream& ts, int indent) const |
83 { | 83 { |
84 writeIndent(ts, indent); | 84 writeIndent(ts, indent); |
85 ts << "[feFlood"; | 85 ts << "[feFlood"; |
86 FilterEffect::externalRepresentation(ts); | 86 FilterEffect::externalRepresentation(ts); |
87 ts << " flood-color=\"" << floodColor().nameForLayoutTreeAsText() << "\" " | 87 ts << " flood-color=\"" << floodColor().nameForLayoutTreeAsText() << "\" " |
88 << "flood-opacity=\"" << floodOpacity() << "\"]\n"; | 88 << "flood-opacity=\"" << floodOpacity() << "\"]\n"; |
89 return ts; | 89 return ts; |
90 } | 90 } |
91 | 91 |
92 } // namespace blink | 92 } // namespace blink |
OLD | NEW |