https://bugs.webkit.org/show_bug.cgi?id=76658
Patch by Dana Jansens <danakj@chromium.org> on 2012-01-20
Reviewed by James Robinson.
Source/WebCore:
Test: compositing/culling/tile-occlusion-boundaries.html
* platform/graphics/chromium/cc/CCQuadCuller.cpp:
(WebCore::enclosedIntRect):
(WebCore::CCQuadCuller::cullOccludedQuads):
LayoutTests:
* compositing/culling/tile-occlusion-boundaries-expected.png: Added.
* compositing/culling/tile-occlusion-boundaries-expected.txt: Added.
* compositing/culling/tile-occlusion-boundaries.html: Added.
* compositing/resources/green.jpg: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105561
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-20 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Partially filled pixels do not occlude pixels below them.
+ https://bugs.webkit.org/show_bug.cgi?id=76658
+
+ Reviewed by James Robinson.
+
+ * compositing/culling/tile-occlusion-boundaries-expected.png: Added.
+ * compositing/culling/tile-occlusion-boundaries-expected.txt: Added.
+ * compositing/culling/tile-occlusion-boundaries.html: Added.
+ * compositing/resources/green.jpg: Added.
+
2012-01-20 Adam Barth <abarth@webkit.org>
Add a Chromium-specific baselines for
--- /dev/null
+<html>
+<head>
+ <style>
+ .scaled { /* Ends up 255.5px by 255.5px */
+ position:relative;
+ left: 128; top: 128;
+ width:511px;
+ height:511px;
+ -webkit-transform: translateZ(0px) scale(0.5);
+ }
+ body { position:relative; }
+ </style>
+
+ <script type="text/javascript" charset="utf-8">
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText(true);
+ }
+ </script>
+</head>
+
+<body style="margin:0; padding:0;">
+<!--
+ If the test passes you should see a solid green square with no blue on its edges.
+
+ The image sits such that it completely fills a tile in the white background layer. However some of the edge pixels of the box are only partially
+ filled, so they end up being blended with part of the pixel behind them. If culling treats them as opaque, then the background tile below is culled
+ inappropriately, and the edge pixels come out mixed with blue since the partial pixels behind were not filled.
+-->
+<img class="scaled green" src="../../fast/images/resources/green.jpg"></img>
+</body>
+</html>
+2012-01-20 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Partially filled pixels do not occlude pixels below them.
+ https://bugs.webkit.org/show_bug.cgi?id=76658
+
+ Reviewed by James Robinson.
+
+ Test: compositing/culling/tile-occlusion-boundaries.html
+
+ * platform/graphics/chromium/cc/CCQuadCuller.cpp:
+ (WebCore::enclosedIntRect):
+ (WebCore::CCQuadCuller::cullOccludedQuads):
+
2012-01-20 Ami Fischman <fischman@chromium.org>
Small cleanup of {get,put}CurrentFrame for WebMediaPlayerClientImpl/CCVideoLayerImpl.
#include "cc/CCRenderPass.h"
#include "cc/CCRenderSurfaceDrawQuad.h"
+using namespace std;
+
namespace std {
// Specialize for OwnPtr<CCDrawQuad> since Vector doesn't know how to reverse a Vector of OwnPtr<T> in general.
return rectRegion.isEmpty();
}
+static IntRect enclosedIntRect(const FloatRect& rect)
+{
+ float x = ceilf(rect.x());
+ float y = ceilf(rect.y());
+ // A rect of width 0 should not become a rect of width -1.
+ float width = max<float>(floorf(rect.maxX()) - x, 0);
+ float height = max<float>(floorf(rect.maxY()) - y, 0);
+
+ return IntRect(clampToInteger(x), clampToInteger(y),
+ clampToInteger(width), clampToInteger(height));
+}
+
void CCQuadCuller::cullOccludedQuads(CCQuadList& quadList)
{
if (!quadList.size())
bool keepQuad = !regionContainsRect(opaqueCoverageThusFar, quadRect);
- if (keepQuad && drawQuad->drawsOpaque() && drawQuad->isLayerAxisAlignedIntRect())
- opaqueCoverageThusFar.unite(Region(quadRect));
+ if (keepQuad && drawQuad->drawsOpaque() && drawQuad->isLayerAxisAlignedIntRect()) {
+ IntRect opaqueRect = enclosedIntRect(drawQuad->quadTransform().mapRect(FloatRect(drawQuad->quadRect())));
+ opaqueCoverageThusFar.unite(opaqueRect);
+ }
if (keepQuad)
culledList.append(quadList[i].release());