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

Unified Diff: Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp

Issue 10146014: Merge 113677 - [chromium] Viewport is not filled when out of texture memory on mac (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp (revision 114754)
+++ Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp (working copy)
@@ -194,26 +194,25 @@
// FIXME: Remove usePaintTracking when paint tracking is on for paint culling.
template<typename LayerType>
-static inline Region computeOcclusionBehindLayer(const LayerType* layer, const TransformationMatrix& transform, bool usePaintTracking)
+static inline Region computeOcclusionBehindLayer(const LayerType* layer, const TransformationMatrix& transform, const Region& opaqueContents, bool usePaintTracking)
{
- Region opaqueRegion;
+ ASSERT(layer->visibleLayerRect().contains(opaqueContents.bounds()));
FloatQuad unoccludedQuad = transform.mapQuad(FloatQuad(layer->visibleLayerRect()));
bool isPaintedAxisAligned = unoccludedQuad.isRectilinear();
if (!isPaintedAxisAligned)
- return opaqueRegion;
+ return Region();
- if (layer->opaque())
- opaqueRegion = enclosedIntRect(unoccludedQuad.boundingBox());
- else if (usePaintTracking && transform.isIdentity())
- opaqueRegion = layer->visibleContentOpaqueRegion();
+ Region transformedOpaqueContents;
+ if (usePaintTracking && transform.isIdentity())
+ transformedOpaqueContents = opaqueContents;
else if (usePaintTracking) {
- Region contentRegion = layer->visibleContentOpaqueRegion();
- Vector<IntRect> contentRects = contentRegion.rects();
+ Vector<IntRect> contentRects = opaqueContents.rects();
for (size_t i = 0; i < contentRects.size(); ++i)
- opaqueRegion.unite(enclosedIntRect(transform.mapRect(FloatRect(contentRects[i]))));
+ transformedOpaqueContents.unite(enclosedIntRect(transform.mapRect(FloatRect(contentRects[i]))));
}
- return opaqueRegion;
+
+ return transformedOpaqueContents;
}
template<typename LayerType, typename RenderSurfaceType>
@@ -227,11 +226,15 @@
if (!layerOpacityKnown(layer) || layer->drawOpacity() < 1)
return;
+ Region opaqueContents = layer->visibleContentOpaqueRegion();
+ if (opaqueContents.isEmpty())
+ return;
+
// FIXME: Remove m_usePaintTracking when paint tracking is on for paint culling.
if (layerTransformsToScreenKnown(layer))
- m_stack.last().occlusionInScreen.unite(computeOcclusionBehindLayer<LayerType>(layer, contentToScreenSpaceTransform<LayerType>(layer), m_usePaintTracking));
+ m_stack.last().occlusionInScreen.unite(computeOcclusionBehindLayer<LayerType>(layer, contentToScreenSpaceTransform<LayerType>(layer), opaqueContents, m_usePaintTracking));
if (layerTransformsToTargetKnown(layer))
- m_stack.last().occlusionInTarget.unite(computeOcclusionBehindLayer<LayerType>(layer, contentToTargetSurfaceTransform<LayerType>(layer), m_usePaintTracking));
+ m_stack.last().occlusionInTarget.unite(computeOcclusionBehindLayer<LayerType>(layer, contentToTargetSurfaceTransform<LayerType>(layer), opaqueContents, m_usePaintTracking));
}
static inline bool testContentRectOccluded(const IntRect& contentRect, const TransformationMatrix& contentSpaceTransform, const IntRect& scissorRect, const Region& occlusion)

Powered by Google App Engine
This is Rietveld 408576698