| OLD | NEW |
| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 String BitmapImage::filenameExtension() const { | 259 String BitmapImage::filenameExtension() const { |
| 260 return m_source.filenameExtension(); | 260 return m_source.filenameExtension(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void BitmapImage::draw( | 263 void BitmapImage::draw( |
| 264 PaintCanvas* canvas, | 264 PaintCanvas* canvas, |
| 265 const PaintFlags& flags, | 265 const PaintFlags& flags, |
| 266 const FloatRect& dstRect, | 266 const FloatRect& dstRect, |
| 267 const FloatRect& srcRect, | 267 const FloatRect& srcRect, |
| 268 RespectImageOrientationEnum shouldRespectImageOrientation, | 268 RespectImageOrientationEnum shouldRespectImageOrientation, |
| 269 ImageClampingMode clampMode, | 269 ImageClampingMode clampMode) { |
| 270 const ColorBehavior& colorBehavior) { | |
| 271 TRACE_EVENT0("skia", "BitmapImage::draw"); | 270 TRACE_EVENT0("skia", "BitmapImage::draw"); |
| 272 | 271 |
| 273 sk_sp<SkImage> image = imageForCurrentFrame(colorBehavior); | 272 sk_sp<SkImage> image = |
| 273 imageForCurrentFrame(ColorBehavior::transformToGlobalTarget()); |
| 274 if (!image) | 274 if (!image) |
| 275 return; // It's too early and we don't have an image yet. | 275 return; // It's too early and we don't have an image yet. |
| 276 | 276 |
| 277 FloatRect adjustedSrcRect = srcRect; | 277 FloatRect adjustedSrcRect = srcRect; |
| 278 adjustedSrcRect.intersect(SkRect::Make(image->bounds())); | 278 adjustedSrcRect.intersect(SkRect::Make(image->bounds())); |
| 279 | 279 |
| 280 if (adjustedSrcRect.isEmpty() || dstRect.isEmpty()) | 280 if (adjustedSrcRect.isEmpty() || dstRect.isEmpty()) |
| 281 return; // Nothing to draw. | 281 return; // Nothing to draw. |
| 282 | 282 |
| 283 ImageOrientation orientation = DefaultImageOrientation; | 283 ImageOrientation orientation = DefaultImageOrientation; |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 getImageObserver()->animationAdvanced(this); | 653 getImageObserver()->animationAdvanced(this); |
| 654 | 654 |
| 655 return true; | 655 return true; |
| 656 } | 656 } |
| 657 | 657 |
| 658 void BitmapImage::notifyObserversOfAnimationAdvance(TimerBase*) { | 658 void BitmapImage::notifyObserversOfAnimationAdvance(TimerBase*) { |
| 659 getImageObserver()->animationAdvanced(this); | 659 getImageObserver()->animationAdvanced(this); |
| 660 } | 660 } |
| 661 | 661 |
| 662 } // namespace blink | 662 } // namespace blink |
| OLD | NEW |