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

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

Issue 1482953002: Drop dependency on LayoutObject in fetch/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fix Created 5 years 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 { 429 {
430 if (m_frames.size() <= index) 430 if (m_frames.size() <= index)
431 return true; 431 return true;
432 432
433 if (m_frames[index].m_haveMetadata) 433 if (m_frames[index].m_haveMetadata)
434 return m_frames[index].m_hasAlpha; 434 return m_frames[index].m_hasAlpha;
435 435
436 return m_source.frameHasAlphaAtIndex(index); 436 return m_source.frameHasAlphaAtIndex(index);
437 } 437 }
438 438
439 bool BitmapImage::currentFrameKnownToBeOpaque() 439 bool BitmapImage::currentFrameKnownToBeOpaque(MetadataMode metadataMode)
440 { 440 {
441 if (metadataMode == PreCacheMetadata) {
442 // frameHasAlphaAtIndex() conservatively returns false for uncached fram es. To increase the
443 // chance of an accurate answer, pre-cache the current frame metadata.
444 frameAtIndex(currentFrame());
445 }
441 return !frameHasAlphaAtIndex(currentFrame()); 446 return !frameHasAlphaAtIndex(currentFrame());
442 } 447 }
443 448
444 bool BitmapImage::currentFrameIsComplete() 449 bool BitmapImage::currentFrameIsComplete()
445 { 450 {
446 return frameIsCompleteAtIndex(currentFrame()); 451 return frameIsCompleteAtIndex(currentFrame());
447 } 452 }
448 453
449 bool BitmapImage::currentFrameIsLazyDecoded() 454 bool BitmapImage::currentFrameIsLazyDecoded()
450 { 455 {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 destroyDecodedDataIfNecessary(); 669 destroyDecodedDataIfNecessary();
665 670
666 // We need to draw this frame if we advanced to it while not skipping, or if 671 // We need to draw this frame if we advanced to it while not skipping, or if
667 // while trying to skip frames we hit the last frame and thus had to stop. 672 // while trying to skip frames we hit the last frame and thus had to stop.
668 if (skippingFrames != advancedAnimation) 673 if (skippingFrames != advancedAnimation)
669 imageObserver()->animationAdvanced(this); 674 imageObserver()->animationAdvanced(this);
670 return advancedAnimation; 675 return advancedAnimation;
671 } 676 }
672 677
673 } // namespace blink 678 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698