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

Side by Side Diff: Source/platform/graphics/CrossfadeGeneratedImage.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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 context->endLayer(); 74 context->endLayer();
75 } 75 }
76 76
77 void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& ds tRect, const FloatRect& srcRect, CompositeOperator compositeOp, WebBlendMode ble ndMode) 77 void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& ds tRect, const FloatRect& srcRect, CompositeOperator compositeOp, WebBlendMode ble ndMode)
78 { 78 {
79 // Draw nothing if either of the images hasn't loaded yet. 79 // Draw nothing if either of the images hasn't loaded yet.
80 if (m_fromImage == Image::nullImage() || m_toImage == Image::nullImage()) 80 if (m_fromImage == Image::nullImage() || m_toImage == Image::nullImage())
81 return; 81 return;
82 82
83 GraphicsContextStateSaver stateSaver(*context); 83 GraphicsContextStateSaver stateSaver(*context);
84 context->setCompositeOperation(compositeOp, blendMode); 84 context->setCompositeOperation(WebCoreCompositeToSkiaComposite(compositeOp, blendMode));
85 context->clip(dstRect); 85 context->clip(dstRect);
86 context->translate(dstRect.x(), dstRect.y()); 86 context->translate(dstRect.x(), dstRect.y());
87 if (dstRect.size() != srcRect.size()) 87 if (dstRect.size() != srcRect.size())
88 context->scale(dstRect.width() / srcRect.width(), dstRect.height() / src Rect.height()); 88 context->scale(dstRect.width() / srcRect.width(), dstRect.height() / src Rect.height());
89 context->translate(-srcRect.x(), -srcRect.y()); 89 context->translate(-srcRect.x(), -srcRect.y());
90 90
91 drawCrossfade(context); 91 drawCrossfade(context);
92 } 92 }
93 93
94 void CrossfadeGeneratedImage::drawTile(GraphicsContext* context, const FloatRect & srcRect) 94 void CrossfadeGeneratedImage::drawTile(GraphicsContext* context, const FloatRect & srcRect)
95 { 95 {
96 // Draw nothing if either of the images hasn't loaded yet. 96 // Draw nothing if either of the images hasn't loaded yet.
97 if (m_fromImage == Image::nullImage() || m_toImage == Image::nullImage()) 97 if (m_fromImage == Image::nullImage() || m_toImage == Image::nullImage())
98 return; 98 return;
99 99
100 drawCrossfade(context); 100 drawCrossfade(context);
101 } 101 }
102 102
103 } // namespace blink 103 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGRenderingContext.cpp ('k') | Source/platform/graphics/GeneratedImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698