Diff
Modified: trunk/Source/WebCore/ChangeLog (113594 => 113595)
--- trunk/Source/WebCore/ChangeLog 2012-04-09 18:09:57 UTC (rev 113594)
+++ trunk/Source/WebCore/ChangeLog 2012-04-09 18:13:44 UTC (rev 113595)
@@ -1,3 +1,18 @@
+2012-04-09 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r113561.
+ http://trac.webkit.org/changeset/113561
+ https://bugs.webkit.org/show_bug.cgi?id=83487
+
+ broke webkit_unit_tests (Requested by simonjam on #webkit).
+
+ * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
+ (WebCore::transformSurfaceOpaqueRegion):
+ (WebCore::computeOcclusionBehindLayer):
+ (WebCore::::markOccludedBehindLayer):
+ (WebCore::testContentRectOccluded):
+ (WebCore::computeUnoccludedContentRect):
+
2012-04-09 Levi Weintraub <[email protected]>
Correct LayoutUnit usage in style functions getRoundedBorderFor
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp (113594 => 113595)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp 2012-04-09 18:09:57 UTC (rev 113594)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp 2012-04-09 18:13:44 UTC (rev 113595)
@@ -115,16 +115,13 @@
// Verify that rects within the |surface| will remain rects in its target surface after applying |transform|. If this is true, then
// apply |transform| to each rect within |region| in order to transform the entire Region.
- bool clipped;
- FloatQuad transformedBoundsQuad = CCMathUtil::mapQuad(transform, FloatQuad(region.bounds()), clipped);
- // FIXME: Find a rect interior to each transformed quad.
- if (clipped || !transformedBoundsQuad.isRectilinear())
+ FloatQuad transformedBoundsQuad = transform.mapQuad(FloatQuad(region.bounds()));
+ if (!transformedBoundsQuad.isRectilinear())
return Region();
Region transformedRegion;
Vector<IntRect> rects = region.rects();
- // Clipping has been verified above, so mapRect will give correct results.
for (size_t i = 0; i < rects.size(); ++i)
transformedRegion.unite(enclosedIntRect(transform.mapRect(FloatRect(rects[i]))));
return transformedRegion;
@@ -198,15 +195,13 @@
// FIXME: Remove usePaintTracking when paint tracking is on for paint culling.
template<typename LayerType>
-static inline Region computeOcclusionBehindLayer(const LayerType* layer, const TransformationMatrix& transform, const IntRect& scissorRect, bool usePaintTracking)
+static inline Region computeOcclusionBehindLayer(const LayerType* layer, const TransformationMatrix& transform, bool usePaintTracking)
{
Region opaqueRegion;
- bool clipped;
- FloatQuad unoccludedQuad = CCMathUtil::mapQuad(transform, FloatQuad(layer->visibleLayerRect()), clipped);
+ FloatQuad unoccludedQuad = transform.mapQuad(FloatQuad(layer->visibleLayerRect()));
bool isPaintedAxisAligned = unoccludedQuad.isRectilinear();
- // FIXME: Find a rect interior to each transformed quad.
- if (clipped || !isPaintedAxisAligned)
+ if (!isPaintedAxisAligned)
return opaqueRegion;
if (layer->opaque())
@@ -216,11 +211,9 @@
else if (usePaintTracking) {
Region contentRegion = layer->visibleContentOpaqueRegion();
Vector<IntRect> contentRects = contentRegion.rects();
- // We verify that the possible bounds of this region are not clipped above, so we can use mapRect() safely here.
for (size_t i = 0; i < contentRects.size(); ++i)
opaqueRegion.unite(enclosedIntRect(transform.mapRect(FloatRect(contentRects[i]))));
}
- opaqueRegion.intersect(scissorRect);
return opaqueRegion;
}
@@ -235,26 +228,16 @@
if (!layerOpacityKnown(layer) || layer->drawOpacity() < 1)
return;
- IntRect scissorInTarget = layerScissorRectInTargetSurface(layer);
+ // 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));
if (layerTransformsToTargetKnown(layer))
- m_stack.last().occlusionInTarget.unite(computeOcclusionBehindLayer<LayerType>(layer, contentToTargetSurfaceTransform<LayerType>(layer), scissorInTarget, m_usePaintTracking));
-
- // We must clip the occlusion within the layer's scissorInTarget within screen space as well. If the scissor rect can't be moved to screen space and
- // remain rectilinear, then we don't add any occlusion in screen space.
-
- if (layerTransformsToScreenKnown(layer)) {
- TransformationMatrix targetToScreenTransform = m_stack.last().surface->screenSpaceTransform();
- FloatQuad scissorInScreenQuad = targetToScreenTransform.mapQuad(FloatQuad(FloatRect(scissorInTarget)));
- if (!scissorInScreenQuad.isRectilinear())
- return;
- IntRect scissorInScreenRect = intersection(m_scissorRectInScreenSpace, enclosedIntRect(CCMathUtil::mapClippedRect(targetToScreenTransform, FloatRect(scissorInTarget))));
- m_stack.last().occlusionInScreen.unite(computeOcclusionBehindLayer<LayerType>(layer, contentToScreenSpaceTransform<LayerType>(layer), scissorInScreenRect, m_usePaintTracking));
- }
+ m_stack.last().occlusionInTarget.unite(computeOcclusionBehindLayer<LayerType>(layer, contentToTargetSurfaceTransform<LayerType>(layer), m_usePaintTracking));
}
static inline bool testContentRectOccluded(const IntRect& contentRect, const TransformationMatrix& contentSpaceTransform, const IntRect& scissorRect, const Region& occlusion)
{
- FloatRect transformedRect = CCMathUtil::mapClippedRect(contentSpaceTransform, FloatRect(contentRect));
+ FloatRect transformedRect = contentSpaceTransform.mapRect(FloatRect(contentRect));
// Take the enclosingIntRect, as we want to include partial pixels in the test.
IntRect targetRect = intersection(enclosingIntRect(transformedRect), scissorRect);
return targetRect.isEmpty() || occlusion.contains(targetRect);
@@ -298,10 +281,13 @@
if (!contentSpaceTransform.isInvertible())
return contentRect;
+ FloatRect transformedRect = contentSpaceTransform.mapRect(FloatRect(contentRect));
// Take the enclosingIntRect at each step, as we want to contain any unoccluded partial pixels in the resulting IntRect.
- FloatRect transformedRect = CCMathUtil::mapClippedRect(contentSpaceTransform, FloatRect(contentRect));
IntRect shrunkRect = rectSubtractRegion(intersection(enclosingIntRect(transformedRect), scissorRect), occlusion);
- IntRect unoccludedRect = enclosingIntRect(CCMathUtil::projectClippedRect(contentSpaceTransform.inverse(), FloatRect(shrunkRect)));
+ bool clipped; // FIXME: We should be able to use projectClippedQuad instead of forcing everything to be unoccluded. https://bugs.webkit.org/show_bug.cgi?id=83217.
+ IntRect unoccludedRect = enclosingIntRect(CCMathUtil::projectQuad(contentSpaceTransform.inverse(), FloatQuad(FloatRect(shrunkRect)), clipped).boundingBox());
+ if (clipped)
+ return contentRect;
// The rect back in content space is a bounding box and may extend outside of the original contentRect, so clamp it to the contentRectBounds.
return intersection(unoccludedRect, contentRect);
}
Modified: trunk/Source/WebKit/chromium/ChangeLog (113594 => 113595)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-04-09 18:09:57 UTC (rev 113594)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-04-09 18:13:44 UTC (rev 113595)
@@ -1,3 +1,16 @@
+2012-04-09 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r113561.
+ http://trac.webkit.org/changeset/113561
+ https://bugs.webkit.org/show_bug.cgi?id=83487
+
+ broke webkit_unit_tests (Requested by simonjam on #webkit).
+
+ * tests/CCOcclusionTrackerTest.cpp:
+ (WebKitTests):
+ * tests/CCQuadCullerTest.cpp:
+ (WebCore::TestCCOcclusionTrackerImpl::TestCCOcclusionTrackerImpl):
+
2012-04-09 Dana Jansens <[email protected]>
[chromium] Make culling work with clipped rects
Modified: trunk/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp (113594 => 113595)
--- trunk/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp 2012-04-09 18:09:57 UTC (rev 113594)
+++ trunk/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp 2012-04-09 18:13:44 UTC (rev 113595)
@@ -1674,65 +1674,6 @@
MAIN_THREAD_TEST(CCOcclusionTrackerTestPerspectiveTransformBehindCamera);
template<class Types, bool opaqueLayers>
-class CCOcclusionTrackerTestLayerBehindCameraDoesNotOcclude : public CCOcclusionTrackerTest<Types, opaqueLayers> {
-protected:
- void runMyTest()
- {
- TransformationMatrix transform;
- transform.translate(50, 50);
- transform.applyPerspective(100);
- transform.translate3d(0, 0, 110);
- transform.translate(-50, -50);
-
- typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(100, 100));
- typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, transform, FloatPoint(0, 0), IntSize(100, 100), true);
- parent->setPreserves3D(true);
- this->calcDrawEtc(parent);
-
- TestCCOcclusionTrackerWithScissor<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.enterTargetRenderSurface(parent->renderSurface());
-
- // This layer is entirely behind the camera and should not occlude.
- occlusion.markOccludedBehindLayer(layer);
- EXPECT_EQ(0u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_EQ(0u, occlusion.occlusionInScreenSpace().rects().size());
- }
-};
-
-MAIN_THREAD_TEST(CCOcclusionTrackerTestLayerBehindCameraDoesNotOcclude);
-
-template<class Types, bool opaqueLayers>
-class CCOcclusionTrackerTestLargePixelsOccludeInsideClipRect : public CCOcclusionTrackerTest<Types, opaqueLayers> {
-protected:
- void runMyTest()
- {
- TransformationMatrix transform;
- transform.translate(50, 50);
- transform.applyPerspective(100);
- transform.translate3d(0, 0, 99);
- transform.translate(-50, -50);
-
- typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(100, 100));
- typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, transform, FloatPoint(0, 0), IntSize(100, 100), true);
- parent->setPreserves3D(true);
- this->calcDrawEtc(parent);
-
- TestCCOcclusionTrackerWithScissor<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.enterTargetRenderSurface(parent->renderSurface());
-
- // This is very close to the camera, so pixels in its visibleLayerRect will actually go outside of the layer's clipRect.
- // Ensure that those pixels don't occlude things outside the clipRect.
- occlusion.markOccludedBehindLayer(layer);
- EXPECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds());
- EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInScreenSpace().bounds());
- EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- }
-};
-
-MAIN_THREAD_TEST(CCOcclusionTrackerTestLargePixelsOccludeInsideClipRect);
-
-template<class Types, bool opaqueLayers>
class CCOcclusionTrackerTestAnimationOpacity1OnMainThread : public CCOcclusionTrackerTest<Types, opaqueLayers> {
protected:
void runMyTest()
Modified: trunk/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp (113594 => 113595)
--- trunk/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp 2012-04-09 18:09:57 UTC (rev 113594)
+++ trunk/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp 2012-04-09 18:13:44 UTC (rev 113595)
@@ -44,9 +44,8 @@
: CCOcclusionTrackerImpl(scissorRectInScreen, recordMetricsForFrame)
, m_scissorRectInScreen(scissorRectInScreen)
{
- // Pretend we have visited the root render surface.
+ // Pretend we have visited a render surface.
m_stack.append(StackObject());
- m_stack.last().surface = new CCRenderSurface(0);
}
protected: