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

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

Issue 2743363006: Clean up cc/paint interfaces (Closed)
Patch Set: Fix PaintControllerTest v2 Created 3 years, 9 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 if (orientation.usesWidthAsHeight()) { 291 if (orientation.usesWidthAsHeight()) {
292 // The destination rect will have its width and height already reversed 292 // The destination rect will have its width and height already reversed
293 // for the orientation of the image, as it was needed for page layout, so 293 // for the orientation of the image, as it was needed for page layout, so
294 // we need to reverse it back here. 294 // we need to reverse it back here.
295 adjustedDstRect = 295 adjustedDstRect =
296 FloatRect(adjustedDstRect.x(), adjustedDstRect.y(), 296 FloatRect(adjustedDstRect.x(), adjustedDstRect.y(),
297 adjustedDstRect.height(), adjustedDstRect.width()); 297 adjustedDstRect.height(), adjustedDstRect.width());
298 } 298 }
299 } 299 }
300 300
301 canvas->drawImageRect(image.get(), adjustedSrcRect, adjustedDstRect, &flags, 301 uint32_t uniqueID = image->uniqueID();
302 bool isLazyGenerated = image->isLazyGenerated();
303
304 canvas->drawImageRect(std::move(image), adjustedSrcRect, adjustedDstRect,
305 &flags,
302 WebCoreClampingModeToSkiaRectConstraint(clampMode)); 306 WebCoreClampingModeToSkiaRectConstraint(clampMode));
303 307
304 if (image->isLazyGenerated()) 308 if (isLazyGenerated)
305 PlatformInstrumentation::didDrawLazyPixelRef(image->uniqueID()); 309 PlatformInstrumentation::didDrawLazyPixelRef(uniqueID);
306 310
307 startAnimation(); 311 startAnimation();
308 } 312 }
309 313
310 size_t BitmapImage::frameCount() { 314 size_t BitmapImage::frameCount() {
311 if (!m_haveFrameCount) { 315 if (!m_haveFrameCount) {
312 m_frameCount = m_source.frameCount(); 316 m_frameCount = m_source.frameCount();
313 // If decoder is not initialized yet, m_source.frameCount() returns 0. 317 // If decoder is not initialized yet, m_source.frameCount() returns 0.
314 if (m_frameCount) 318 if (m_frameCount)
315 m_haveFrameCount = true; 319 m_haveFrameCount = true;
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 getImageObserver()->animationAdvanced(this); 639 getImageObserver()->animationAdvanced(this);
636 640
637 return true; 641 return true;
638 } 642 }
639 643
640 void BitmapImage::notifyObserversOfAnimationAdvance(TimerBase*) { 644 void BitmapImage::notifyObserversOfAnimationAdvance(TimerBase*) {
641 getImageObserver()->animationAdvanced(this); 645 getImageObserver()->animationAdvanced(this);
642 } 646 }
643 647
644 } // namespace blink 648 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698