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

Side by Side Diff: Source/platform/graphics/Image.cpp

Issue 840733004: Replace setCompositeOperation(CompositeOperator, WebBlendMode) with setCompositeOperation(SkXfermod… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rename compositeOperationDeprecated Created 5 years, 11 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return true; 90 return true;
91 91
92 return dataChanged(allDataReceived); 92 return dataChanged(allDataReceived);
93 } 93 }
94 94
95 void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, CompositeOperator op) 95 void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, CompositeOperator op)
96 { 96 {
97 if (!color.alpha()) 97 if (!color.alpha())
98 return; 98 return;
99 99
100 CompositeOperator previousOperator = ctxt->compositeOperation(); 100 SkXfermode::Mode previousOperation = ctxt->compositeOperation();
101 ctxt->setCompositeOperation(!color.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op); 101 ctxt->setCompositeOperation(!color.hasAlpha() && op == CompositeSourceOver ? SkXfermode::kSrc_Mode : WebCoreCompositeToSkiaComposite(op));
102 ctxt->fillRect(dstRect, color); 102 ctxt->fillRect(dstRect, color);
103 ctxt->setCompositeOperation(previousOperator); 103 ctxt->setCompositeOperation(previousOperation);
104 } 104 }
105 105
106 FloatRect Image::adjustForNegativeSize(const FloatRect& rect) 106 FloatRect Image::adjustForNegativeSize(const FloatRect& rect)
107 { 107 {
108 FloatRect norm = rect; 108 FloatRect norm = rect;
109 if (norm.width() < 0) { 109 if (norm.width() < 0) {
110 norm.setX(norm.x() + norm.width()); 110 norm.setX(norm.x() + norm.width());
111 norm.setWidth(-norm.width()); 111 norm.setWidth(-norm.width());
112 } 112 }
113 if (norm.height() < 0) { 113 if (norm.height() < 0) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 return image.release(); 245 return image.release();
246 } 246 }
247 247
248 PassRefPtr<SkImage> Image::skImage() 248 PassRefPtr<SkImage> Image::skImage()
249 { 249 {
250 return nullptr; 250 return nullptr;
251 } 251 }
252 252
253 } // namespace blink 253 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContextTest.cpp ('k') | Source/platform/graphics/paint/CompositingDisplayItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698