mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove RenderObject::isVideo
BUG= R=abarth@chromium.org Review URL: https://codereview.chromium.org/709503003
This commit is contained in:
parent
6e9d657373
commit
fa52a2cb76
@ -537,7 +537,7 @@ LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox*
|
||||
{
|
||||
child->clearOverrideSize();
|
||||
|
||||
if (child->style()->hasAspectRatio() || child->isImage() || child->isVideo() || child->isCanvas())
|
||||
if (child->style()->hasAspectRatio() || child->isImage() || child->isCanvas())
|
||||
UseCounter::count(document(), UseCounter::AspectRatioFlexItem);
|
||||
|
||||
Length flexBasis = flexBasisForChild(child);
|
||||
|
||||
@ -520,7 +520,7 @@ void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, dou
|
||||
}
|
||||
// Don't compute an intrinsic ratio to preserve historical WebKit behavior if we're painting alt text and/or a broken image.
|
||||
// Video is excluded from this behavior because video elements have a default aspect ratio that a failed poster image load should not override.
|
||||
if (m_imageResource && m_imageResource->errorOccurred() && !isVideo()) {
|
||||
if (m_imageResource && m_imageResource->errorOccurred()) {
|
||||
intrinsicRatio = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -330,7 +330,6 @@ public:
|
||||
virtual bool isRenderImage() const { return false; }
|
||||
virtual bool isRenderInline() const { return false; }
|
||||
virtual bool isRenderView() const { return false; }
|
||||
virtual bool isVideo() const { return false; }
|
||||
virtual bool isWidget() const { return false; }
|
||||
|
||||
bool isDocumentElement() const { return document().documentElement() == m_node; }
|
||||
|
||||
@ -229,7 +229,7 @@ bool RenderReplaced::needsPreferredWidthsRecalculation() const
|
||||
static inline bool rendererHasAspectRatio(const RenderObject* renderer)
|
||||
{
|
||||
ASSERT(renderer);
|
||||
return renderer->isImage() || renderer->isCanvas() || renderer->isVideo();
|
||||
return renderer->isImage() || renderer->isCanvas();
|
||||
}
|
||||
|
||||
void RenderReplaced::computeAspectRatioInformationForRenderBox(FloatSize& constrainedSize, double& intrinsicRatio) const
|
||||
@ -260,7 +260,7 @@ LayoutRect RenderReplaced::replacedContentRect(const LayoutSize* overriddenIntri
|
||||
ObjectFit objectFit = style()->objectFit();
|
||||
|
||||
if (objectFit == ObjectFitFill && style()->objectPosition() == RenderStyle::initialObjectPosition()) {
|
||||
if (!isVideo() || RuntimeEnabledFeatures::objectFitPositionEnabled())
|
||||
if (RuntimeEnabledFeatures::objectFitPositionEnabled())
|
||||
return contentRect;
|
||||
objectFit = ObjectFitContain;
|
||||
}
|
||||
|
||||
@ -120,8 +120,7 @@ static bool contentLayerSupportsDirectBackgroundComposition(const RenderObject*
|
||||
|
||||
static inline bool isAcceleratedContents(RenderObject* renderer)
|
||||
{
|
||||
return isAcceleratedCanvas(renderer)
|
||||
|| renderer->isVideo();
|
||||
return isAcceleratedCanvas(renderer);
|
||||
}
|
||||
|
||||
// Get the scrolling coordinator in a way that works inside CompositedLayerMapping's destructor.
|
||||
|
||||
@ -120,16 +120,6 @@ CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const
|
||||
if (!squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree)
|
||||
return CompositingReasonSquashingWouldBreakPaintOrder;
|
||||
|
||||
// FIXME: this special case for video exists only to deal with corner cases
|
||||
// where a RenderVideo does not report that it needs to be directly composited.
|
||||
// Video does not currently support sharing a backing, but this could be
|
||||
// generalized in the future. The following layout tests fail if we permit the
|
||||
// video to share a backing with other layers.
|
||||
//
|
||||
// compositing/video/video-controls-layer-creation.html
|
||||
if (layer->renderer()->isVideo())
|
||||
return CompositingReasonSquashingVideoIsDisallowed;
|
||||
|
||||
if (squashingWouldExceedSparsityTolerance(layer, squashingState))
|
||||
return CompositingReasonSquashingSparsityExceeded;
|
||||
|
||||
|
||||
@ -213,13 +213,6 @@ void CompositingRequirementsUpdater::updateRecursive(RenderLayer* ancestorLayer,
|
||||
CompositingReasons reasonsToComposite = CompositingReasonNone;
|
||||
CompositingReasons directReasons = m_compositingReasonFinder.directReasons(layer);
|
||||
|
||||
// Video is special. It's the only RenderLayer type that can both have
|
||||
// RenderLayer children and whose children can't use its backing to render
|
||||
// into. These children (the controls) always need to be promoted into their
|
||||
// own layers to draw on top of the accelerated video.
|
||||
if (currentRecursionData.m_compositingAncestor && currentRecursionData.m_compositingAncestor->renderer()->isVideo())
|
||||
directReasons |= CompositingReasonVideoOverlay;
|
||||
|
||||
if (compositor->canBeComposited(layer))
|
||||
reasonsToComposite |= directReasons;
|
||||
|
||||
|
||||
@ -43,9 +43,6 @@ const CompositingReasonStringMap kCompositingReasonStringMap[] = {
|
||||
{ CompositingReasonOutOfFlowClipping,
|
||||
"outOfFlowClipping",
|
||||
"Has clipping ancestor" },
|
||||
{ CompositingReasonVideoOverlay,
|
||||
"videoOverlay",
|
||||
"Is overlay controls for video" },
|
||||
{ CompositingReasonWillChangeCompositingHint,
|
||||
"willChange",
|
||||
"Has a will-change compositing hint" },
|
||||
|
||||
@ -27,7 +27,6 @@ const uint64_t CompositingReasonTransitionProperty = UINT6
|
||||
const uint64_t CompositingReasonOverflowScrollingTouch = UINT64_C(1) << 9;
|
||||
const uint64_t CompositingReasonOverflowScrollingParent = UINT64_C(1) << 10;
|
||||
const uint64_t CompositingReasonOutOfFlowClipping = UINT64_C(1) << 11;
|
||||
const uint64_t CompositingReasonVideoOverlay = UINT64_C(1) << 12;
|
||||
const uint64_t CompositingReasonWillChangeCompositingHint = UINT64_C(1) << 13;
|
||||
|
||||
// Overlap reasons that require knowing what's behind you in paint-order before knowing the answer
|
||||
@ -93,7 +92,6 @@ const uint64_t CompositingReasonComboAllDirectReasons =
|
||||
| CompositingReasonOverflowScrollingTouch
|
||||
| CompositingReasonOverflowScrollingParent
|
||||
| CompositingReasonOutOfFlowClipping
|
||||
| CompositingReasonVideoOverlay
|
||||
| CompositingReasonWillChangeCompositingHint;
|
||||
|
||||
const uint64_t CompositingReasonComboAllDirectStyleDeterminedReasons =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user