[Chromium] Cull occluded tiles in tiled layers

https://bugs.webkit.org/show_bug.cgi?id=70533

Reviewed by James Robinson.

Source/WebCore:

Unit test provided, must pass all existing GPU layout tests.

* WebCore.gypi:
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::appendQuads):
(WebCore::CCLayerImpl::quadTransform):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
(WebCore::CCLayerTreeHostImpl::optimizeRenderPasses):
(WebCore::CCLayerTreeHostImpl::drawLayers):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
* platform/graphics/chromium/cc/CCQuadCuller.cpp: Added.
(std::swap):
(WebCore::regionContainsRect):
(WebCore::CCQuadCuller::cullOccludedQuads):
* platform/graphics/chromium/cc/CCQuadCuller.h: Added.
(WebCore::CCQuadCuller::CCQuadCuller):
* platform/graphics/chromium/cc/CCRenderPass.cpp:
(WebCore::CCRenderPass::optimizeQuads):
* platform/graphics/chromium/cc/CCRenderPass.h:

Source/WebKit/chromium:

* WebKit.gypi:
* tests/CCQuadCullerTest.cpp: Added.
(WebCore::TestDrawQuad::TestDrawQuad):
(WebCore::TestDrawQuad::create):
(WebCore::setQuads):
(WebCore::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104368 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f18273ae
2012-01-06 W. James MacLean <wjmaclean@chromium.org>
[Chromium] Cull occluded tiles in tiled layers
https://bugs.webkit.org/show_bug.cgi?id=70533
Reviewed by James Robinson.
Unit test provided, must pass all existing GPU layout tests.
* WebCore.gypi:
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::appendQuads):
(WebCore::CCLayerImpl::quadTransform):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
(WebCore::CCLayerTreeHostImpl::optimizeRenderPasses):
(WebCore::CCLayerTreeHostImpl::drawLayers):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
* platform/graphics/chromium/cc/CCQuadCuller.cpp: Added.
(std::swap):
(WebCore::regionContainsRect):
(WebCore::CCQuadCuller::cullOccludedQuads):
* platform/graphics/chromium/cc/CCQuadCuller.h: Added.
(WebCore::CCQuadCuller::CCQuadCuller):
* platform/graphics/chromium/cc/CCRenderPass.cpp:
(WebCore::CCRenderPass::optimizeQuads):
* platform/graphics/chromium/cc/CCRenderPass.h:
2012-01-06 Anders Carlsson <andersca@apple.com>
Move more rubberbanding code into ScrollAnimatorMac::smoothScrollWithEvent
......@@ -3637,6 +3637,8 @@
'platform/graphics/chromium/cc/CCPluginLayerImpl.h',
'platform/graphics/chromium/cc/CCProxy.cpp',
'platform/graphics/chromium/cc/CCProxy.h',
'platform/graphics/chromium/cc/CCQuadCuller.cpp',
'platform/graphics/chromium/cc/CCQuadCuller.h',
'platform/graphics/chromium/cc/CCRenderPass.cpp',
'platform/graphics/chromium/cc/CCRenderPass.h',
'platform/graphics/chromium/cc/CCRenderSurface.cpp',
......
......@@ -129,8 +129,8 @@ PassOwnPtr<CCSharedQuadState> CCLayerImpl::createSharedQuadState() const
void CCLayerImpl::appendQuads(CCQuadList& quadList, const CCSharedQuadState* sharedQuadState)
{
IntRect layerRect(IntPoint(), bounds());
quadList.append(CCCustomLayerDrawQuad::create(sharedQuadState, layerRect, this));
IntRect quadRect(IntPoint(), bounds());
quadList.append(CCCustomLayerDrawQuad::create(sharedQuadState, quadRect, this));
}
void CCLayerImpl::appendDebugBorderQuad(CCQuadList& quadList, const CCSharedQuadState* sharedQuadState) const
......@@ -176,7 +176,13 @@ const IntRect CCLayerImpl::getDrawRect() const
TransformationMatrix CCLayerImpl::quadTransform() const
{
return drawTransform();
TransformationMatrix quadTransformation = drawTransform();
float offsetX = -0.5 * bounds().width();
float offsetY = -0.5 * bounds().height();
quadTransformation.translate(offsetX, offsetY);
return quadTransformation;
}
void CCLayerImpl::writeIndent(TextStream& ts, int indent)
......
......@@ -187,7 +187,7 @@ static FloatRect damageInSurfaceSpace(CCLayerImpl* renderSurfaceLayer, const Flo
return surfaceDamageRect;
}
void CCLayerTreeHostImpl::calculateRenderPasses(Vector<OwnPtr<CCRenderPass> >& passes)
void CCLayerTreeHostImpl::calculateRenderPasses(CCRenderPassList& passes)
{
CCLayerList renderSurfaceLayerList;
renderSurfaceLayerList.append(rootLayer());
......@@ -238,6 +238,12 @@ void CCLayerTreeHostImpl::calculateRenderPasses(Vector<OwnPtr<CCRenderPass> >& p
}
}
void CCLayerTreeHostImpl::optimizeRenderPasses(CCRenderPassList& passes)
{
for (unsigned i = 0; i < passes.size(); ++i)
passes[i]->optimizeQuads();
}
void CCLayerTreeHostImpl::drawLayers()
{
TRACE_EVENT("CCLayerTreeHostImpl::drawLayers", this, 0);
......@@ -246,9 +252,11 @@ void CCLayerTreeHostImpl::drawLayers()
if (!rootLayer())
return;
Vector<OwnPtr<CCRenderPass> > passes;
CCRenderPassList passes;
calculateRenderPasses(passes);
optimizeRenderPasses(passes);
m_layerRenderer->beginDrawingFrame();
for (size_t i = 0; i < passes.size(); ++i)
m_layerRenderer->drawRenderPass(passes[i].get());
......
......@@ -133,7 +133,8 @@ private:
void adjustScrollsForPageScaleChange(float);
void updateMaxScrollPosition();
void trackDamageForAllSurfaces(CCLayerImpl* rootDrawLayer, const CCLayerList& renderSurfaceLayerList);
void calculateRenderPasses(Vector<OwnPtr<CCRenderPass> >&);
void calculateRenderPasses(CCRenderPassList&);
void optimizeRenderPasses(CCRenderPassList&);
OwnPtr<LayerRendererChromium> m_layerRenderer;
RefPtr<CCLayerImpl> m_rootLayerImpl;
......
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#if USE(ACCELERATED_COMPOSITING)
#include "cc/CCQuadCuller.h"
#include "Region.h"
#include "TransformationMatrix.h"
#include "cc/CCCustomLayerDrawQuad.h"
#include "cc/CCLayerImpl.h"
#include "cc/CCRenderPass.h"
#include "cc/CCRenderSurfaceDrawQuad.h"
namespace std {
// Specialize for OwnPtr<CCDrawQuad> since Vector doesn't know how to reverse a Vector of OwnPtr<T> in general.
template<>
void swap(OwnPtr<WebCore::CCDrawQuad>& a, OwnPtr<WebCore::CCDrawQuad>& b)
{
a.swap(b);
}
}
namespace WebCore {
static bool regionContainsRect(const Region& region, const IntRect& rect)
{
Region rectRegion(rect);
Region intersectRegion(intersect(region, rectRegion));
if (intersectRegion.isEmpty())
return false;
rectRegion.subtract(intersectRegion);
return rectRegion.isEmpty();
}
void CCQuadCuller::cullOccludedQuads(CCQuadList& quadList)
{
if (!quadList.size())
return;
CCQuadList culledList;
culledList.reserveCapacity(quadList.size());
Region opaqueCoverageThusFar;
for (int i = quadList.size() - 1; i >= 0; --i) {
CCDrawQuad* drawQuad = quadList[i].get();
IntRect quadRect(drawQuad->quadTransform().mapRect(drawQuad->quadRect()));
bool keepQuad = !regionContainsRect(opaqueCoverageThusFar, quadRect);
if (keepQuad && drawQuad->drawsOpaque() && drawQuad->isLayerAxisAlignedIntRect())
opaqueCoverageThusFar.unite(Region(quadRect));
if (keepQuad)
culledList.append(quadList[i].release());
}
quadList.clear(); // Release anything that remains.
culledList.reverse();
quadList.swap(culledList);
}
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CCQuadCuller_h
#define CCQuadCuller_h
#include "cc/CCRenderPass.h"
namespace WebCore {
class CCQuadCuller {
public:
static void cullOccludedQuads(CCQuadList&);
private:
// Make non-instantiable.
CCQuadCuller() { }
};
}
#endif // CCQuadCuller_h
......@@ -28,6 +28,7 @@
#include "cc/CCRenderPass.h"
#include "cc/CCLayerImpl.h"
#include "cc/CCQuadCuller.h"
#include "cc/CCRenderSurfaceDrawQuad.h"
#include "cc/CCSharedQuadState.h"
......@@ -63,4 +64,9 @@ void CCRenderPass::appendQuadsForRenderSurfaceLayer(CCLayerImpl* layer)
m_sharedQuadStateList.append(sharedQuadState.release());
}
void CCRenderPass::optimizeQuads()
{
CCQuadCuller::cullOccludedQuads(m_quadList);
}
}
......@@ -46,6 +46,8 @@ public:
void appendQuadsForLayer(CCLayerImpl*);
void appendQuadsForRenderSurfaceLayer(CCLayerImpl*);
void optimizeQuads();
const CCQuadList& quadList() const { return m_quadList; }
CCRenderSurface* targetSurface() const { return m_targetSurface; }
......@@ -61,6 +63,8 @@ private:
FloatRect m_surfaceDamageRect;
};
typedef Vector<OwnPtr<CCRenderPass> > CCRenderPassList;
}
#endif
2012-01-06 W. James MacLean <wjmaclean@chromium.org>
[Chromium] Cull occluded tiles in tiled layers
https://bugs.webkit.org/show_bug.cgi?id=70533
Reviewed by James Robinson.
* WebKit.gypi:
* tests/CCQuadCullerTest.cpp: Added.
(WebCore::TestDrawQuad::TestDrawQuad):
(WebCore::TestDrawQuad::create):
(WebCore::setQuads):
(WebCore::TEST):
2012-01-06 Greg Billock <gbillock@google.com>
[Web Intents] Flagged-off WebCore implementation of navigator.startActivity
......
......@@ -70,6 +70,7 @@
'tests/CCLayerTreeHostImplTest.cpp',
'tests/CCLayerTreeHostTest.cpp',
'tests/CCLayerTreeTestCommon.h',
'tests/CCQuadCullerTest.cpp',
'tests/CCRenderSurfaceTest.cpp',
'tests/CCSchedulerStateMachineTest.cpp',
'tests/CCSchedulerTestCommon.h',
......
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "cc/CCQuadCuller.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
using namespace WebCore;
namespace {
class CCQuadCullerTest : public testing::Test {
};
class TestDrawQuad : public CCDrawQuad {
public:
TestDrawQuad(const CCSharedQuadState* state, Material m, const IntRect& rect)
: CCDrawQuad(state, m, rect)
{
}
static PassOwnPtr<TestDrawQuad> create(const CCSharedQuadState* state, Material m, const IntRect& rect)
{
return adoptPtr(new TestDrawQuad(state, m, rect));
}
};
void setQuads(CCSharedQuadState* rootState, CCSharedQuadState* childState, CCQuadList& quadList)
{
quadList.clear();
quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 0), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(200, 0), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(0, 100), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 100), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(200, 100), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(0, 200), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 200), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(200, 200), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(childState, CCDrawQuad::TiledContent, IntRect(IntPoint(), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(childState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 0), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(childState, CCDrawQuad::TiledContent, IntRect(IntPoint(0, 100), IntSize(100, 100))));
quadList.append(TestDrawQuad::create(childState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 100), IntSize(100, 100))));
}
#define DECLARE_AND_INITIALIZE_TEST_QUADS \
CCQuadList quadList; \
TransformationMatrix childTransform; \
IntSize rootSize = IntSize(300, 300); \
IntRect rootRect = IntRect(IntPoint(), rootSize); \
IntSize childSize = IntSize(200, 200); \
IntRect childRect = IntRect(IntPoint(), childSize);
TEST(CCQuadCullerTest, verifyCullChildLinesUpTopLeft)
{
DECLARE_AND_INITIALIZE_TEST_QUADS
OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, true);
setQuads(rootState.get(), childState.get(), quadList);
EXPECT_EQ(quadList.size(), 13u);
CCQuadCuller::cullOccludedQuads(quadList);
EXPECT_EQ(quadList.size(), 9u);
}
TEST(CCQuadCullerTest, verifyCullWhenChildOpacityNotOne)
{
DECLARE_AND_INITIALIZE_TEST_QUADS
OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 0.9, true);
setQuads(rootState.get(), childState.get(), quadList);
EXPECT_EQ(quadList.size(), 13u);
CCQuadCuller::cullOccludedQuads(quadList);
EXPECT_EQ(quadList.size(), 13u);
}
TEST(CCQuadCullerTest, verifyCullWhenChildOpaqueFlagFalse)
{
DECLARE_AND_INITIALIZE_TEST_QUADS
OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, false);
setQuads(rootState.get(), childState.get(), quadList);
EXPECT_EQ(quadList.size(), 13u);
CCQuadCuller::cullOccludedQuads(quadList);
EXPECT_EQ(quadList.size(), 13u);
}
TEST(CCQuadCullerTest, verifyCullCenterTileOnly)
{
DECLARE_AND_INITIALIZE_TEST_QUADS
childTransform.translate(50, 50);
OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, true);
setQuads(rootState.get(), childState.get(), quadList);
EXPECT_EQ(quadList.size(), 13u);
CCQuadCuller::cullOccludedQuads(quadList);
EXPECT_EQ(quadList.size(), 12u);
}
TEST(CCQuadCullerTest, verifyCullChildLinesUpBottomRight)
{
DECLARE_AND_INITIALIZE_TEST_QUADS
childTransform.translate(100, 100);
OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, true);
setQuads(rootState.get(), childState.get(), quadList);
EXPECT_EQ(quadList.size(), 13u);
CCQuadCuller::cullOccludedQuads(quadList);
EXPECT_EQ(quadList.size(), 9u);
}
TEST(CCQuadCullerTest, verifyNonAxisAlignedQuadsDontOcclude)
{
DECLARE_AND_INITIALIZE_TEST_QUADS
// Use a small rotation so as to not disturb the geometry significantly.
childTransform.rotate(1);
OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, true);
setQuads(rootState.get(), childState.get(), quadList);
EXPECT_EQ(quadList.size(), 13u);
CCQuadCuller::cullOccludedQuads(quadList);
EXPECT_EQ(quadList.size(), 13u);
}
// This test requires some explanation: here we are rotating the quads to be culled.
// The 2x2 tile child layer remains in the top-left corner, unrotated, but the 3x3
// tile parent layer is rotated by 1 degree. Of the four tiles the child would
// normally occlude, three will move (slightly) out from under the child layer, and
// one moves further under the child. Only this last tile should be culled.
TEST(CCQuadCullerTest, verifyNonAxisAlignedQuadsSafelyCulled)
{
DECLARE_AND_INITIALIZE_TEST_QUADS
// Use a small rotation so as to not disturb the geometry significantly.
TransformationMatrix parentTransform;
parentTransform.rotate(1);
OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(parentTransform, TransformationMatrix(), rootRect, IntRect(), 1.0, true);
OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), childRect, IntRect(), 1.0, true);
setQuads(rootState.get(), childState.get(), quadList);
EXPECT_EQ(quadList.size(), 13u);
CCQuadCuller::cullOccludedQuads(quadList);
EXPECT_EQ(quadList.size(), 12u);
}
} // namespace
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment