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

Side by Side Diff: Source/platform/graphics/filters/FEComposite.cpp

Issue 779963002: Add the 'lighter' composite operation to feComposite. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years 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
« no previous file with comments | « Source/platform/graphics/filters/FEComposite.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 /* 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) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 case FECOMPOSITE_OPERATOR_OVER: 177 case FECOMPOSITE_OPERATOR_OVER:
178 return SkXfermode::kSrcOver_Mode; 178 return SkXfermode::kSrcOver_Mode;
179 case FECOMPOSITE_OPERATOR_IN: 179 case FECOMPOSITE_OPERATOR_IN:
180 return SkXfermode::kSrcIn_Mode; 180 return SkXfermode::kSrcIn_Mode;
181 case FECOMPOSITE_OPERATOR_OUT: 181 case FECOMPOSITE_OPERATOR_OUT:
182 return SkXfermode::kSrcOut_Mode; 182 return SkXfermode::kSrcOut_Mode;
183 case FECOMPOSITE_OPERATOR_ATOP: 183 case FECOMPOSITE_OPERATOR_ATOP:
184 return SkXfermode::kSrcATop_Mode; 184 return SkXfermode::kSrcATop_Mode;
185 case FECOMPOSITE_OPERATOR_XOR: 185 case FECOMPOSITE_OPERATOR_XOR:
186 return SkXfermode::kXor_Mode; 186 return SkXfermode::kXor_Mode;
187 case FECOMPOSITE_OPERATOR_LIGHTER:
188 return SkXfermode::kPlus_Mode;
187 default: 189 default:
188 ASSERT_NOT_REACHED(); 190 ASSERT_NOT_REACHED();
189 return SkXfermode::kSrcOver_Mode; 191 return SkXfermode::kSrcOver_Mode;
190 } 192 }
191 } 193 }
192 194
193 PassRefPtr<SkImageFilter> FEComposite::createImageFilter(SkiaImageFilterBuilder* builder) 195 PassRefPtr<SkImageFilter> FEComposite::createImageFilter(SkiaImageFilterBuilder* builder)
194 { 196 {
195 return createImageFilterInternal(builder, true); 197 return createImageFilterInternal(builder, true);
196 } 198 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 break; 232 break;
231 case FECOMPOSITE_OPERATOR_ATOP: 233 case FECOMPOSITE_OPERATOR_ATOP:
232 ts << "ATOP"; 234 ts << "ATOP";
233 break; 235 break;
234 case FECOMPOSITE_OPERATOR_XOR: 236 case FECOMPOSITE_OPERATOR_XOR:
235 ts << "XOR"; 237 ts << "XOR";
236 break; 238 break;
237 case FECOMPOSITE_OPERATOR_ARITHMETIC: 239 case FECOMPOSITE_OPERATOR_ARITHMETIC:
238 ts << "ARITHMETIC"; 240 ts << "ARITHMETIC";
239 break; 241 break;
242 case FECOMPOSITE_OPERATOR_LIGHTER:
243 ts << "LIGHTER";
244 break;
240 } 245 }
241 return ts; 246 return ts;
242 } 247 }
243 248
244 TextStream& FEComposite::externalRepresentation(TextStream& ts, int indent) cons t 249 TextStream& FEComposite::externalRepresentation(TextStream& ts, int indent) cons t
245 { 250 {
246 writeIndent(ts, indent); 251 writeIndent(ts, indent);
247 ts << "[feComposite"; 252 ts << "[feComposite";
248 FilterEffect::externalRepresentation(ts); 253 FilterEffect::externalRepresentation(ts);
249 ts << " operation=\"" << m_type << "\""; 254 ts << " operation=\"" << m_type << "\"";
250 if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC) 255 if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC)
251 ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\ " k4=\"" << m_k4 << "\""; 256 ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\ " k4=\"" << m_k4 << "\"";
252 ts << "]\n"; 257 ts << "]\n";
253 inputEffect(0)->externalRepresentation(ts, indent + 1); 258 inputEffect(0)->externalRepresentation(ts, indent + 1);
254 inputEffect(1)->externalRepresentation(ts, indent + 1); 259 inputEffect(1)->externalRepresentation(ts, indent + 1);
255 return ts; 260 return ts;
256 } 261 }
257 262
258 } // namespace blink 263 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/filters/FEComposite.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698