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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutVideo.cpp

Issue 1728313003: Split ImageResourceClient into ResourceClient and ImageResourceObserver [2/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and reflect comment Created 4 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) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // <video> in standalone media documents should not use the default 300x150 102 // <video> in standalone media documents should not use the default 300x150
103 // size since they also have audio-only files. By setting the intrinsic 103 // size since they also have audio-only files. By setting the intrinsic
104 // size to 300x1 the video will resize itself in these cases, and audio will 104 // size to 300x1 the video will resize itself in these cases, and audio will
105 // have the correct height (it needs to be > 0 for controls to layout proper ly). 105 // have the correct height (it needs to be > 0 for controls to layout proper ly).
106 if (video->ownerDocument() && video->ownerDocument()->isMediaDocument()) 106 if (video->ownerDocument() && video->ownerDocument()->isMediaDocument())
107 return LayoutSize(defaultSize().width(), LayoutUnit(1)); 107 return LayoutSize(defaultSize().width(), LayoutUnit(1));
108 108
109 return defaultSize(); 109 return defaultSize();
110 } 110 }
111 111
112 void LayoutVideo::imageChanged(WrappedImagePtr newImage, const IntRect* rect) 112 void LayoutVideo::imageChanged(bool isNotifyingFinish, WrappedImagePtr newImage, const IntRect* rect)
113 { 113 {
114 LayoutMedia::imageChanged(newImage, rect); 114 LayoutMedia::imageChanged(isNotifyingFinish, newImage, rect);
115 115
116 // Cache the image intrinsic size so we can continue to use it to draw the i mage correctly 116 // Cache the image intrinsic size so we can continue to use it to draw the i mage correctly
117 // even if we know the video intrinsic size but aren't able to draw video fr ames yet 117 // even if we know the video intrinsic size but aren't able to draw video fr ames yet
118 // (we don't want to scale the poster to the video size without keeping aspe ct ratio). 118 // (we don't want to scale the poster to the video size without keeping aspe ct ratio).
119 if (videoElement()->shouldDisplayPosterImage()) 119 if (videoElement()->shouldDisplayPosterImage())
120 m_cachedImageSize = intrinsicSize(); 120 m_cachedImageSize = intrinsicSize();
121 121
122 // The intrinsic size is now that of the image, but in case we already had t he 122 // The intrinsic size is now that of the image, but in case we already had t he
123 // intrinsic size of the video we call this here to restore the video size. 123 // intrinsic size of the video we call this here to restore the video size.
124 updateIntrinsicSize(); 124 updateIntrinsicSize();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) 244 if (element->isFullscreen() && element->usesOverlayFullscreenVideo())
245 return CompositingReasonVideo; 245 return CompositingReasonVideo;
246 246
247 if (shouldDisplayVideo() && supportsAcceleratedRendering()) 247 if (shouldDisplayVideo() && supportsAcceleratedRendering())
248 return CompositingReasonVideo; 248 return CompositingReasonVideo;
249 249
250 return CompositingReasonNone; 250 return CompositingReasonNone;
251 } 251 }
252 252
253 } // namespace blink 253 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698