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

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

Issue 868743002: Use SkXfermode::Mode in code related to Image. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to ToT 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, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 bool BitmapImage::hasColorProfile() const 253 bool BitmapImage::hasColorProfile() const
254 { 254 {
255 return m_source.hasColorProfile(); 255 return m_source.hasColorProfile();
256 } 256 }
257 257
258 String BitmapImage::filenameExtension() const 258 String BitmapImage::filenameExtension() const
259 { 259 {
260 return m_source.filenameExtension(); 260 return m_source.filenameExtension();
261 } 261 }
262 262
263 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const Fl oatRect& srcRect, CompositeOperator compositeOp, WebBlendMode blendMode, Respect ImageOrientationEnum shouldRespectImageOrientation) 263 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const Fl oatRect& srcRect, SkXfermode::Mode compositeOp, RespectImageOrientationEnum shou ldRespectImageOrientation)
264 { 264 {
265 // Spin the animation to the correct frame before we try to draw it, so we 265 // Spin the animation to the correct frame before we try to draw it, so we
266 // don't draw an old frame and then immediately need to draw a newer one, 266 // don't draw an old frame and then immediately need to draw a newer one,
267 // causing flicker and wasting CPU. 267 // causing flicker and wasting CPU.
268 startAnimation(); 268 startAnimation();
269 269
270 RefPtr<NativeImageSkia> image = nativeImageForCurrentFrame(); 270 RefPtr<NativeImageSkia> image = nativeImageForCurrentFrame();
271 if (!image) 271 if (!image)
272 return; // It's too early and we don't have an image yet. 272 return; // It's too early and we don't have an image yet.
273 273
(...skipping 18 matching lines...) Expand all
292 292
293 ctxt->concatCTM(orientation.transformFromDefault(normDstRect.size())); 293 ctxt->concatCTM(orientation.transformFromDefault(normDstRect.size()));
294 294
295 if (orientation.usesWidthAsHeight()) { 295 if (orientation.usesWidthAsHeight()) {
296 // The destination rect will have it's width and height already reve rsed for the orientation of 296 // The destination rect will have it's width and height already reve rsed for the orientation of
297 // the image, as it was needed for page layout, so we need to revers e it back here. 297 // the image, as it was needed for page layout, so we need to revers e it back here.
298 normDstRect = FloatRect(normDstRect.x(), normDstRect.y(), normDstRec t.height(), normDstRect.width()); 298 normDstRect = FloatRect(normDstRect.x(), normDstRect.y(), normDstRec t.height(), normDstRect.width());
299 } 299 }
300 } 300 }
301 301
302 image->draw(ctxt, normSrcRect, normDstRect, compositeOp, blendMode); 302 image->draw(ctxt, normSrcRect, normDstRect, compositeOp);
303 303
304 if (ImageObserver* observer = imageObserver()) 304 if (ImageObserver* observer = imageObserver())
305 observer->didDraw(this); 305 observer->didDraw(this);
306 } 306 }
307 307
308 void BitmapImage::resetDecoder() 308 void BitmapImage::resetDecoder()
309 { 309 {
310 ASSERT(isMainThread()); 310 ASSERT(isMainThread());
311 311
312 m_source.resetDecoder(); 312 m_source.resetDecoder();
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 651
652 return m_isSolidColor && !m_currentFrame; 652 return m_isSolidColor && !m_currentFrame;
653 } 653 }
654 654
655 Color BitmapImage::solidColor() const 655 Color BitmapImage::solidColor() const
656 { 656 {
657 return m_solidColor; 657 return m_solidColor;
658 } 658 }
659 659
660 } // namespace blink 660 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/BitmapImage.h ('k') | Source/platform/graphics/CrossfadeGeneratedImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698