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

Side by Side Diff: Source/core/platform/graphics/CrossfadeGeneratedImage.cpp

Issue 23643003: ImageBuffer-less SVG masking and clipping. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix the Win build. Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/platform/graphics/GraphicsContext.h » ('j') | 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) 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 // Draw the image we're fading towards. 71 // Draw the image we're fading towards.
72 context->save(); 72 context->save();
73 if (m_crossfadeSize != toImageSize) 73 if (m_crossfadeSize != toImageSize)
74 context->scale(FloatSize(static_cast<float>(m_crossfadeSize.width()) / t oImageSize.width(), 74 context->scale(FloatSize(static_cast<float>(m_crossfadeSize.width()) / t oImageSize.width(),
75 static_cast<float>(m_crossfadeSize.height()) / toImageSize.height())); 75 static_cast<float>(m_crossfadeSize.height()) / toImageSize.height()));
76 context->setAlpha(m_percentage); 76 context->setAlpha(m_percentage);
77 context->drawImage(m_toImage, IntPoint(), CompositePlusLighter); 77 context->drawImage(m_toImage, IntPoint(), CompositePlusLighter);
78 context->restore(); 78 context->restore();
79 79
80 context->endTransparencyLayer(); 80 context->endLayer();
81 } 81 }
82 82
83 void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& ds tRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendM ode) 83 void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& ds tRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendM ode)
84 { 84 {
85 GraphicsContextStateSaver stateSaver(*context); 85 GraphicsContextStateSaver stateSaver(*context);
86 context->setCompositeOperation(compositeOp, blendMode); 86 context->setCompositeOperation(compositeOp, blendMode);
87 context->clip(dstRect); 87 context->clip(dstRect);
88 context->translate(dstRect.x(), dstRect.y()); 88 context->translate(dstRect.x(), dstRect.y());
89 if (dstRect.size() != srcRect.size()) 89 if (dstRect.size() != srcRect.size())
90 context->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.heig ht() / srcRect.height())); 90 context->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.heig ht() / srcRect.height()));
(...skipping 10 matching lines...) Expand all
101 101
102 // Fill with the cross-faded image. 102 // Fill with the cross-faded image.
103 GraphicsContext* graphicsContext = imageBuffer->context(); 103 GraphicsContext* graphicsContext = imageBuffer->context();
104 drawCrossfade(graphicsContext); 104 drawCrossfade(graphicsContext);
105 105
106 // Tile the image buffer into the context. 106 // Tile the image buffer into the context.
107 imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRec t, blendMode); 107 imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRec t, blendMode);
108 } 108 }
109 109
110 } 110 }
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698