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

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

Issue 2172503002: Fix subpixel accumulation for composited content layers Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test expectation Created 4 years, 5 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // even if we know the video intrinsic size but aren't able to draw video fr ames yet 115 // even if we know the video intrinsic size but aren't able to draw video fr ames yet
116 // (we don't want to scale the poster to the video size without keeping aspe ct ratio). 116 // (we don't want to scale the poster to the video size without keeping aspe ct ratio).
117 if (videoElement()->shouldDisplayPosterImage()) 117 if (videoElement()->shouldDisplayPosterImage())
118 m_cachedImageSize = intrinsicSize(); 118 m_cachedImageSize = intrinsicSize();
119 119
120 // The intrinsic size is now that of the image, but in case we already had t he 120 // The intrinsic size is now that of the image, but in case we already had t he
121 // intrinsic size of the video we call this here to restore the video size. 121 // intrinsic size of the video we call this here to restore the video size.
122 updateIntrinsicSize(); 122 updateIntrinsicSize();
123 } 123 }
124 124
125 IntRect LayoutVideo::videoBox() const 125 LayoutRect LayoutVideo::videoBox() const
126 { 126 {
127 const LayoutSize* overriddenIntrinsicSize = nullptr; 127 const LayoutSize* overriddenIntrinsicSize = nullptr;
128 if (videoElement()->shouldDisplayPosterImage()) 128 if (videoElement()->shouldDisplayPosterImage())
129 overriddenIntrinsicSize = &m_cachedImageSize; 129 overriddenIntrinsicSize = &m_cachedImageSize;
130 130
131 return pixelSnappedIntRect(replacedContentRect(overriddenIntrinsicSize)); 131 return replacedContentRect(overriddenIntrinsicSize);
132 } 132 }
133 133
134 bool LayoutVideo::shouldDisplayVideo() const 134 bool LayoutVideo::shouldDisplayVideo() const
135 { 135 {
136 return !videoElement()->shouldDisplayPosterImage(); 136 return !videoElement()->shouldDisplayPosterImage();
137 } 137 }
138 138
139 void LayoutVideo::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& p aintOffset) const 139 void LayoutVideo::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& p aintOffset) const
140 { 140 {
141 VideoPainter(*this).paintReplaced(paintInfo, paintOffset); 141 VideoPainter(*this).paintReplaced(paintInfo, paintOffset);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) 201 if (element->isFullscreen() && element->usesOverlayFullscreenVideo())
202 return CompositingReasonVideo; 202 return CompositingReasonVideo;
203 203
204 if (shouldDisplayVideo() && supportsAcceleratedRendering()) 204 if (shouldDisplayVideo() && supportsAcceleratedRendering())
205 return CompositingReasonVideo; 205 return CompositingReasonVideo;
206 206
207 return CompositingReasonNone; 207 return CompositingReasonNone;
208 } 208 }
209 209
210 } // namespace blink 210 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698