Remove most remaining references to IntRect and FloatRect.
The remaining uses are: - Dealing with the output of Region::rects() which gives a vector of WebCore::IntRects. - Using FloatRect::isExpressibleAsIntRect. Covered by existing tests; no new behaviour. BUG=147395 R=enne Review URL: https://codereview.chromium.org/11275113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165542 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
cc
content_layer_unittest.ccdamage_tracker.ccdebug_rect_history.ccdelegated_renderer_layer_impl.ccdirect_renderer.ccdirect_renderer.hfloat_quad_unittest.ccgeometry_binding.ccgeometry_binding.hgl_renderer.ccgl_renderer_unittest.cclayer.cclayer_impl.cclayer_impl.hlayer_impl_unittest.cclayer_sorter.cclayer_sorter_unittest.cclayer_tiling_data.cclayer_tiling_data.hlayer_tree_host.cclayer_tree_host.hlayer_tree_host_impl.cclayer_tree_host_impl.hlayer_tree_host_impl_unittest.cclayer_tree_host_unittest.cclayer_unittest.ccmath_util.ccocclusion_tracker.ccocclusion_tracker.hocclusion_tracker_unittest.ccoverdraw_metrics.ccoverdraw_metrics.hpage_scale_animation.ccpage_scale_animation.hquad_culler.ccrender_pass.ccrender_pass.hrender_surface_unittest.ccscrollbar_layer_impl.ccscrollbar_layer_impl.hsolid_color_layer_impl.ccsolid_color_layer_impl_unittest.cc
stubs
test
texture_layer_unittest.cctiled_layer.cctiled_layer_impl.cctiled_layer_unittest.ccwebkit/compositor_bindings
@ -13,8 +13,6 @@
|
||||
#include "skia/ext/platform_canvas.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "ui/gfx/rect_conversions.h"
|
||||
#include <public/WebFloatRect.h>
|
||||
#include <public/WebRect.h>
|
||||
|
||||
using namespace cc;
|
||||
using namespace WebKit;
|
||||
|
@ -253,7 +253,7 @@ void DamageTracker::extendDamageForLayer(LayerImpl* layer, gfx::RectF& targetDam
|
||||
bool layerIsNew = false;
|
||||
gfx::RectF oldRectInTargetSpace = removeRectFromCurrentFrame(layer->id(), layerIsNew);
|
||||
|
||||
gfx::RectF rectInTargetSpace = MathUtil::mapClippedRect(layer->drawTransform(), gfx::RectF(FloatPoint(), layer->contentBounds()));
|
||||
gfx::RectF rectInTargetSpace = MathUtil::mapClippedRect(layer->drawTransform(), gfx::RectF(gfx::PointF(), layer->contentBounds()));
|
||||
saveRectForNextFrame(layer->id(), rectInTargetSpace);
|
||||
|
||||
if (layerIsNew || layerNeedsToRedrawOntoItsTargetSurface(layer)) {
|
||||
@ -326,7 +326,7 @@ void DamageTracker::extendDamageForRenderSurface(LayerImpl* layer, gfx::RectF& t
|
||||
removeRectFromCurrentFrame(replicaMaskLayer->id(), replicaIsNew);
|
||||
|
||||
const WebTransformationMatrix& replicaDrawTransform = renderSurface->replicaDrawTransform();
|
||||
gfx::RectF replicaMaskLayerRect = MathUtil::mapClippedRect(replicaDrawTransform, gfx::RectF(FloatPoint(), FloatSize(replicaMaskLayer->bounds().width(), replicaMaskLayer->bounds().height())));
|
||||
gfx::RectF replicaMaskLayerRect = MathUtil::mapClippedRect(replicaDrawTransform, gfx::RectF(gfx::PointF(), replicaMaskLayer->bounds()));
|
||||
saveRectForNextFrame(replicaMaskLayer->id(), replicaMaskLayerRect);
|
||||
|
||||
// In the current implementation, a change in the replica mask damages the entire replica region.
|
||||
|
@ -117,7 +117,7 @@ void DebugRectHistory::saveScreenSpaceRects(const std::vector<LayerImpl* >& rend
|
||||
void DebugRectHistory::saveOccludingRects(const std::vector<gfx::Rect>& occludingRects)
|
||||
{
|
||||
for (size_t i = 0; i < occludingRects.size(); ++i)
|
||||
m_debugRects.push_back(DebugRect(OccludingRectType, cc::FloatRect(occludingRects[i])));
|
||||
m_debugRects.push_back(DebugRect(OccludingRectType, occludingRects[i]));
|
||||
}
|
||||
|
||||
} // namespace cc
|
||||
|
@ -154,7 +154,7 @@ void DelegatedRendererLayerImpl::appendRenderPassQuads(QuadSink& quadSink, Appen
|
||||
// This layer must be drawing to a renderTarget other than itself.
|
||||
DCHECK(renderTarget() != this);
|
||||
|
||||
copiedSharedQuadState->clippedRectInTarget = MathUtil::mapClippedRect(drawTransform(), cc::IntRect(copiedSharedQuadState->clippedRectInTarget));
|
||||
copiedSharedQuadState->clippedRectInTarget = MathUtil::mapClippedRect(drawTransform(), copiedSharedQuadState->clippedRectInTarget);
|
||||
copiedSharedQuadState->quadTransform = copiedSharedQuadState->quadTransform * drawTransform();
|
||||
copiedSharedQuadState->opacity *= drawOpacity();
|
||||
}
|
||||
|
@ -66,9 +66,9 @@ DirectRenderer::DrawingFrame::~DrawingFrame()
|
||||
|
||||
//
|
||||
// static
|
||||
FloatRect DirectRenderer::quadVertexRect()
|
||||
gfx::RectF DirectRenderer::quadVertexRect()
|
||||
{
|
||||
return FloatRect(-0.5, -0.5, 1, 1);
|
||||
return gfx::RectF(-0.5, -0.5, 1, 1);
|
||||
}
|
||||
|
||||
// static
|
||||
@ -131,7 +131,7 @@ void DirectRenderer::decideRenderPassAllocationsForFrame(const RenderPassList& r
|
||||
}
|
||||
|
||||
const RenderPass* renderPassInFrame = it->second;
|
||||
const IntSize& requiredSize = renderPassTextureSize(renderPassInFrame);
|
||||
const gfx::Size& requiredSize = renderPassTextureSize(renderPassInFrame);
|
||||
GLenum requiredFormat = renderPassTextureFormat(renderPassInFrame);
|
||||
CachedTexture* texture = passIterator->second;
|
||||
DCHECK(texture);
|
||||
@ -177,7 +177,7 @@ void DirectRenderer::drawRenderPass(DrawingFrame& frame, const RenderPass* rende
|
||||
frame.scissorRectInRenderPassSpace = frame.currentRenderPass->outputRect();
|
||||
if (frame.rootDamageRect != frame.rootRenderPass->outputRect()) {
|
||||
WebTransformationMatrix inverseTransformToRoot = frame.currentRenderPass->transformToRootTarget().inverse();
|
||||
gfx::RectF damageRectInRenderPassSpace = MathUtil::projectClippedRect(inverseTransformToRoot, cc::FloatRect(frame.rootDamageRect));
|
||||
gfx::RectF damageRectInRenderPassSpace = MathUtil::projectClippedRect(inverseTransformToRoot, frame.rootDamageRect);
|
||||
frame.scissorRectInRenderPassSpace.Intersect(damageRectInRenderPassSpace);
|
||||
}
|
||||
|
||||
@ -225,9 +225,9 @@ bool DirectRenderer::haveCachedResourcesForRenderPassId(RenderPass::Id id) const
|
||||
}
|
||||
|
||||
// static
|
||||
IntSize DirectRenderer::renderPassTextureSize(const RenderPass* pass)
|
||||
gfx::Size DirectRenderer::renderPassTextureSize(const RenderPass* pass)
|
||||
{
|
||||
return cc::IntSize(pass->outputRect().size());
|
||||
return pass->outputRect().size();
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -70,13 +70,13 @@ protected:
|
||||
DISALLOW_COPY_AND_ASSIGN(CachedTexture);
|
||||
};
|
||||
|
||||
static FloatRect quadVertexRect();
|
||||
static gfx::RectF quadVertexRect();
|
||||
static void quadRectTransform(WebKit::WebTransformationMatrix* quadRectTransform, const WebKit::WebTransformationMatrix& quadTransform, const gfx::RectF& quadRect);
|
||||
static void initializeMatrices(DrawingFrame&, const gfx::Rect& drawRect, bool flipY);
|
||||
static gfx::Rect moveScissorToWindowSpace(const DrawingFrame&, gfx::RectF scissorRect);
|
||||
|
||||
bool haveCachedResources(RenderPass::Id) const;
|
||||
static IntSize renderPassTextureSize(const RenderPass*);
|
||||
static gfx::Size renderPassTextureSize(const RenderPass*);
|
||||
static GLenum renderPassTextureFormat(const RenderPass*);
|
||||
|
||||
void drawRenderPass(DrawingFrame&, const RenderPass*);
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "FloatQuad.h"
|
||||
#include "cc/math_util.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "ui/gfx/rect_f.h"
|
||||
#include <public/WebTransformationMatrix.h>
|
||||
|
||||
using namespace cc;
|
||||
@ -30,7 +31,7 @@ TEST(FloatQuadTest, IsRectilinearTest)
|
||||
|
||||
for (int i = 0; i < numRectilinear; ++i) {
|
||||
bool clipped = false;
|
||||
FloatQuad quad = MathUtil::mapQuad(rectilinearTrans[i], FloatRect(0.01010101f, 0.01010101f, 100.01010101f, 100.01010101f), clipped);
|
||||
FloatQuad quad = MathUtil::mapQuad(rectilinearTrans[i], gfx::RectF(0.01010101f, 0.01010101f, 100.01010101f, 100.01010101f), clipped);
|
||||
ASSERT_TRUE(!clipped);
|
||||
EXPECT_TRUE(quad.isRectilinear());
|
||||
}
|
||||
@ -50,7 +51,7 @@ TEST(FloatQuadTest, IsRectilinearTest)
|
||||
|
||||
for (int i = 0; i < numNonRectilinear; ++i) {
|
||||
bool clipped = false;
|
||||
FloatQuad quad = MathUtil::mapQuad(nonRectilinearTrans[i], FloatRect(0.01010101f, 0.01010101f, 100.01010101f, 100.01010101f), clipped);
|
||||
FloatQuad quad = MathUtil::mapQuad(nonRectilinearTrans[i], gfx::RectF(0.01010101f, 0.01010101f, 100.01010101f, 100.01010101f), clipped);
|
||||
ASSERT_TRUE(!clipped);
|
||||
EXPECT_FALSE(quad.isRectilinear());
|
||||
}
|
||||
|
@ -8,21 +8,22 @@
|
||||
|
||||
#include "cc/gl_renderer.h" // For the GLC() macro.
|
||||
#include "third_party/khronos/GLES2/gl2.h"
|
||||
#include "ui/gfx/rect_f.h"
|
||||
#include <public/WebGraphicsContext3D.h>
|
||||
|
||||
namespace cc {
|
||||
|
||||
GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, const FloatRect& quadVertexRect)
|
||||
GeometryBinding::GeometryBinding(WebKit::WebGraphicsContext3D* context, const gfx::RectF& quadVertexRect)
|
||||
: m_context(context)
|
||||
, m_quadVerticesVbo(0)
|
||||
, m_quadElementsVbo(0)
|
||||
, m_initialized(false)
|
||||
{
|
||||
// Vertex positions and texture coordinates for the 4 corners of a 1x1 quad.
|
||||
float vertices[] = { quadVertexRect.x(), quadVertexRect.maxY(), 0.0f, 0.0f, 1.0f,
|
||||
float vertices[] = { quadVertexRect.x(), quadVertexRect.bottom(), 0.0f, 0.0f, 1.0f,
|
||||
quadVertexRect.x(), quadVertexRect.y(), 0.0f, 0.0f, 0.0f,
|
||||
quadVertexRect.maxX(), quadVertexRect.y(), 0.0f, 1.0f, 0.0f,
|
||||
quadVertexRect.maxX(), quadVertexRect.maxY(), 0.0f, 1.0f, 1.0f };
|
||||
quadVertexRect.right(), quadVertexRect.y(), 0.0f, 1.0f, 0.0f,
|
||||
quadVertexRect.right(), quadVertexRect.bottom(), 0.0f, 1.0f, 1.0f };
|
||||
uint16_t indices[] = { 0, 1, 2, 0, 2, 3, // The two triangles that make up the layer quad.
|
||||
0, 1, 2, 3}; // A line path for drawing the layer border.
|
||||
|
||||
|
@ -5,7 +5,9 @@
|
||||
#ifndef GeometryBinding_h
|
||||
#define GeometryBinding_h
|
||||
|
||||
#include "FloatRect.h"
|
||||
namespace gfx {
|
||||
class RectF;
|
||||
}
|
||||
|
||||
namespace WebKit {
|
||||
class WebGraphicsContext3D;
|
||||
@ -15,7 +17,7 @@ namespace cc {
|
||||
|
||||
class GeometryBinding {
|
||||
public:
|
||||
GeometryBinding(WebKit::WebGraphicsContext3D*, const FloatRect& quadVertexRect);
|
||||
GeometryBinding(WebKit::WebGraphicsContext3D*, const gfx::RectF& quadVertexRect);
|
||||
~GeometryBinding();
|
||||
|
||||
bool initialized() const { return m_initialized; }
|
||||
|
@ -76,7 +76,7 @@ GLRenderer::GLRenderer(RendererClient* client,
|
||||
ResourceProvider* resourceProvider)
|
||||
: DirectRenderer(client, resourceProvider)
|
||||
, m_offscreenFramebufferId(0)
|
||||
, m_sharedGeometryQuad(FloatRect(-0.5f, -0.5f, 1.0f, 1.0f))
|
||||
, m_sharedGeometryQuad(gfx::RectF(-0.5f, -0.5f, 1.0f, 1.0f))
|
||||
, m_context(resourceProvider->graphicsContext3D())
|
||||
, m_isViewportChanged(false)
|
||||
, m_isFramebufferDiscarded(false)
|
||||
@ -457,7 +457,7 @@ scoped_ptr<ScopedTexture> GLRenderer::drawBackgroundFilters(DrawingFrame& frame,
|
||||
DCHECK(!frame.currentTexture);
|
||||
|
||||
// FIXME: Do a single readback for both the surface and replica and cache the filtered results (once filter textures are not reused).
|
||||
gfx::Rect deviceRect = gfx::ToEnclosingRect(MathUtil::mapClippedRect(contentsDeviceTransform, cc::FloatRect(sharedGeometryQuad().boundingBox())));
|
||||
gfx::Rect deviceRect = gfx::ToEnclosingRect(MathUtil::mapClippedRect(contentsDeviceTransform, sharedGeometryQuad().boundingBox()));
|
||||
|
||||
int top, right, bottom, left;
|
||||
filters.getOutsets(top, right, bottom, left);
|
||||
@ -829,7 +829,7 @@ void GLRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQuad* qua
|
||||
|
||||
GLC(context(), context()->uniform4f(uniforms.vertexTexTransformLocation, vertexTexTranslateX, vertexTexTranslateY, vertexTexScaleX, vertexTexScaleY));
|
||||
|
||||
localQuad = FloatRect(tileRect);
|
||||
localQuad = gfx::RectF(tileRect);
|
||||
}
|
||||
|
||||
// Normalize to tileRect.
|
||||
|
@ -221,7 +221,7 @@ TEST_F(GLRendererTest, FramebufferDiscardedAfterReadbackWhenNotVisible)
|
||||
m_renderer.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses());
|
||||
EXPECT_FALSE(m_renderer.isFramebufferDiscarded());
|
||||
|
||||
m_renderer.getFramebufferPixels(pixels, IntRect(0, 0, 1, 1));
|
||||
m_renderer.getFramebufferPixels(pixels, gfx::Rect(0, 0, 1, 1));
|
||||
EXPECT_TRUE(m_renderer.isFramebufferDiscarded());
|
||||
EXPECT_EQ(2, m_mockClient.setFullRootLayerDamageCount());
|
||||
}
|
||||
|
@ -830,7 +830,7 @@ void Layer::notifyAnimationFinished(double wallClockTime)
|
||||
Region Layer::visibleContentOpaqueRegion() const
|
||||
{
|
||||
if (contentsOpaque())
|
||||
return cc::IntRect(visibleContentRect());
|
||||
return visibleContentRect();
|
||||
return Region();
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ FloatSize LayerImpl::scrollBy(const FloatSize& scroll)
|
||||
return unscrolled;
|
||||
}
|
||||
|
||||
InputHandlerClient::ScrollStatus LayerImpl::tryScroll(const IntPoint& screenSpacePoint, InputHandlerClient::ScrollInputType type) const
|
||||
InputHandlerClient::ScrollStatus LayerImpl::tryScroll(const gfx::Point& screenSpacePoint, InputHandlerClient::ScrollInputType type) const
|
||||
{
|
||||
if (shouldScrollOnMainThread()) {
|
||||
TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed shouldScrollOnMainThread");
|
||||
@ -210,10 +210,10 @@ InputHandlerClient::ScrollStatus LayerImpl::tryScroll(const IntPoint& screenSpac
|
||||
return InputHandlerClient::ScrollIgnored;
|
||||
}
|
||||
|
||||
if (!nonFastScrollableRegion().isEmpty()) {
|
||||
if (!nonFastScrollableRegion().IsEmpty()) {
|
||||
bool clipped = false;
|
||||
gfx::PointF hitTestPointInLocalSpace = MathUtil::projectPoint(screenSpaceTransform().inverse(), FloatPoint(screenSpacePoint), clipped);
|
||||
if (!clipped && nonFastScrollableRegion().contains(cc::IntPoint(gfx::ToFlooredPoint(hitTestPointInLocalSpace)))) {
|
||||
gfx::PointF hitTestPointInLocalSpace = MathUtil::projectPoint(screenSpaceTransform().inverse(), gfx::PointF(screenSpacePoint), clipped);
|
||||
if (!clipped && nonFastScrollableRegion().Contains(gfx::ToFlooredPoint(hitTestPointInLocalSpace))) {
|
||||
TRACE_EVENT0("cc", "LayerImpl::tryScroll: Failed nonFastScrollableRegion");
|
||||
return InputHandlerClient::ScrollOnMainThread;
|
||||
}
|
||||
@ -662,7 +662,7 @@ void LayerImpl::setDoubleSided(bool doubleSided)
|
||||
Region LayerImpl::visibleContentOpaqueRegion() const
|
||||
{
|
||||
if (contentsOpaque())
|
||||
return cc::IntRect(visibleContentRect());
|
||||
return visibleContentRect();
|
||||
return Region();
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef CCLayerImpl_h
|
||||
#define CCLayerImpl_h
|
||||
|
||||
#include "FloatSize.h"
|
||||
#include "Region.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
@ -216,7 +217,7 @@ public:
|
||||
void setDrawCheckerboardForMissingTiles(bool checkerboard) { m_drawCheckerboardForMissingTiles = checkerboard; }
|
||||
bool drawCheckerboardForMissingTiles() const;
|
||||
|
||||
InputHandlerClient::ScrollStatus tryScroll(const IntPoint& viewportPoint, InputHandlerClient::ScrollInputType) const;
|
||||
InputHandlerClient::ScrollStatus tryScroll(const gfx::Point& viewportPoint, InputHandlerClient::ScrollInputType) const;
|
||||
|
||||
const gfx::Rect& visibleContentRect() const { return m_visibleContentRect; }
|
||||
void setVisibleContentRect(const gfx::Rect& visibleContentRect) { m_visibleContentRect = visibleContentRect; }
|
||||
|
@ -72,12 +72,12 @@ TEST(LayerImplTest, verifyLayerChangesAreTrackedProperly)
|
||||
EXPECT_FALSE(child->layerPropertyChanged());
|
||||
EXPECT_FALSE(grandChild->layerPropertyChanged());
|
||||
|
||||
FloatPoint arbitraryFloatPoint = FloatPoint(0.125f, 0.25f);
|
||||
gfx::PointF arbitraryPointF = gfx::PointF(0.125f, 0.25f);
|
||||
float arbitraryNumber = 0.352f;
|
||||
IntSize arbitraryIntSize = IntSize(111, 222);
|
||||
IntPoint arbitraryIntPoint = IntPoint(333, 444);
|
||||
IntRect arbitraryIntRect = IntRect(arbitraryIntPoint, arbitraryIntSize);
|
||||
FloatRect arbitraryFloatRect = FloatRect(arbitraryFloatPoint, FloatSize(1.234f, 5.678f));
|
||||
gfx::Size arbitrarySize = gfx::Size(111, 222);
|
||||
gfx::Point arbitraryPoint = gfx::Point(333, 444);
|
||||
gfx::Rect arbitraryRect = gfx::Rect(arbitraryPoint, arbitrarySize);
|
||||
gfx::RectF arbitraryRectF = gfx::RectF(arbitraryPointF, gfx::SizeF(1.234f, 5.678f));
|
||||
SkColor arbitraryColor = SkColorSetRGB(10, 20, 30);
|
||||
WebTransformationMatrix arbitraryTransform;
|
||||
arbitraryTransform.scale3d(0.1, 0.2, 0.3);
|
||||
@ -91,13 +91,13 @@ TEST(LayerImplTest, verifyLayerChangesAreTrackedProperly)
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setRenderTarget(0));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawTransform(arbitraryTransform));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScreenSpaceTransform(arbitraryTransform));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawableContentRect(arbitraryIntRect));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setUpdateRect(arbitraryFloatRect));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setVisibleContentRect(arbitraryIntRect));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setMaxScrollPosition(arbitraryIntSize));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawableContentRect(arbitraryRect));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setUpdateRect(arbitraryRectF));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setVisibleContentRect(arbitraryRect));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setMaxScrollPosition(cc::IntSize(arbitrarySize)));
|
||||
|
||||
// Changing these properties affects the entire subtree of layers.
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setAnchorPoint(arbitraryFloatPoint));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setAnchorPoint(arbitraryPointF));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setAnchorPointZ(arbitraryNumber));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setFilters(arbitraryFilters));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setFilters(WebFilterOperations()));
|
||||
@ -106,16 +106,16 @@ TEST(LayerImplTest, verifyLayerChangesAreTrackedProperly)
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setMasksToBounds(true));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setContentsOpaque(true));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setReplicaLayer(LayerImpl::create(5)));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setPosition(arbitraryFloatPoint));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setPosition(arbitraryPointF));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setPreserves3D(true));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setDoubleSided(false)); // constructor initializes it to "true".
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->scrollBy(arbitraryIntSize));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScrollDelta(IntSize()));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScrollPosition(arbitraryIntPoint));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->scrollBy(cc::IntSize(arbitrarySize)));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScrollDelta(cc::IntSize()));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScrollPosition(cc::IntPoint(arbitraryPoint)));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setImplTransform(arbitraryTransform));
|
||||
|
||||
// Changing these properties only affects the layer itself.
|
||||
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->setContentBounds(arbitraryIntSize));
|
||||
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->setContentBounds(arbitrarySize));
|
||||
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->setContentsScale(arbitraryNumber, arbitraryNumber));
|
||||
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->setDebugBorderColor(arbitraryColor));
|
||||
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->setDebugBorderWidth(arbitraryNumber));
|
||||
@ -136,23 +136,23 @@ TEST(LayerImplTest, verifyLayerChangesAreTrackedProperly)
|
||||
|
||||
// Special case: check that setBounds changes behavior depending on masksToBounds.
|
||||
root->setMasksToBounds(false);
|
||||
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->setBounds(IntSize(135, 246)));
|
||||
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->setBounds(gfx::Size(135, 246)));
|
||||
root->setMasksToBounds(true);
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setBounds(arbitraryIntSize)); // should be a different size than previous call, to ensure it marks tree changed.
|
||||
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setBounds(arbitrarySize)); // should be a different size than previous call, to ensure it marks tree changed.
|
||||
|
||||
// After setting all these properties already, setting to the exact same values again should
|
||||
// not cause any change.
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setAnchorPoint(arbitraryFloatPoint));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setAnchorPoint(arbitraryPointF));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setAnchorPointZ(arbitraryNumber));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setMasksToBounds(true));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setPosition(arbitraryFloatPoint));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setPosition(arbitraryPointF));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setPreserves3D(true));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setTransform(arbitraryTransform));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDoubleSided(false)); // constructor initializes it to "true".
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScrollDelta(IntSize()));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScrollPosition(arbitraryIntPoint));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScrollDelta(cc::IntSize()));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScrollPosition(cc::IntPoint(arbitraryPoint)));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setImplTransform(arbitraryTransform));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setContentBounds(arbitraryIntSize));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setContentBounds(arbitrarySize));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setContentsScale(arbitraryNumber, arbitraryNumber));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setContentsOpaque(true));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setOpacity(arbitraryNumber));
|
||||
@ -160,7 +160,7 @@ TEST(LayerImplTest, verifyLayerChangesAreTrackedProperly)
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDebugBorderWidth(arbitraryNumber));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDrawsContent(true));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setSublayerTransform(arbitraryTransform));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setBounds(arbitraryIntSize));
|
||||
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setBounds(arbitrarySize));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -149,7 +149,7 @@ LayerShape::LayerShape()
|
||||
|
||||
LayerShape::LayerShape(float width, float height, const WebTransformationMatrix& drawTransform)
|
||||
{
|
||||
FloatQuad layerQuad(FloatRect(0, 0, width, height));
|
||||
FloatQuad layerQuad(gfx::RectF(0, 0, width, height));
|
||||
|
||||
// Compute the projection of the layer quad onto the z = 0 plane.
|
||||
|
||||
@ -158,7 +158,7 @@ LayerShape::LayerShape(float width, float height, const WebTransformationMatrix&
|
||||
MathUtil::mapClippedQuad(drawTransform, layerQuad, clippedQuad, numVerticesInClippedQuad);
|
||||
|
||||
if (numVerticesInClippedQuad < 3) {
|
||||
projectedBounds = FloatRect();
|
||||
projectedBounds = gfx::RectF();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ TEST(LayerSorterTest, LayersUnderPathologicalPerspectiveTransform)
|
||||
|
||||
// Sanity check that the test case actually covers the intended scenario, where part
|
||||
// of layer B go behind the w = 0 plane.
|
||||
FloatQuad testQuad = FloatQuad(FloatRect(FloatPoint(-0.5, -0.5), FloatSize(1, 1)));
|
||||
FloatQuad testQuad = FloatQuad(gfx::RectF(-0.5, -0.5, 1, 1));
|
||||
bool clipped = false;
|
||||
MathUtil::mapQuad(perspectiveMatrix * transformB, testQuad, clipped);
|
||||
ASSERT_TRUE(clipped);
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
#include "cc/layer_tiling_data.h"
|
||||
|
||||
#include "IntRect.h"
|
||||
#include "IntSize.h"
|
||||
#include "base/logging.h"
|
||||
|
||||
using namespace std;
|
||||
@ -117,7 +119,7 @@ Region LayerTilingData::opaqueRegionInContentRect(const gfx::Rect& contentRect)
|
||||
continue;
|
||||
|
||||
gfx::Rect tileOpaqueRect = gfx::IntersectRects(contentRect, tile->opaqueRect());
|
||||
opaqueRegion.unite(cc::IntRect(tileOpaqueRect));
|
||||
opaqueRegion.Union(tileOpaqueRect);
|
||||
}
|
||||
}
|
||||
return opaqueRegion;
|
||||
|
@ -11,11 +11,11 @@
|
||||
#include "cc/hash_pair.h"
|
||||
#include "cc/scoped_ptr_hash_map.h"
|
||||
#include "ui/gfx/rect.h"
|
||||
#include "IntRect.h"
|
||||
#include "Region.h"
|
||||
#include "TilingData.h"
|
||||
|
||||
namespace cc {
|
||||
class IntRect;
|
||||
|
||||
class LayerTilingData {
|
||||
public:
|
||||
|
@ -330,7 +330,7 @@ void LayerTreeHost::didLoseContext()
|
||||
setNeedsCommit();
|
||||
}
|
||||
|
||||
bool LayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect)
|
||||
bool LayerTreeHost::compositeAndReadback(void *pixels, const gfx::Rect& rect)
|
||||
{
|
||||
m_triggerIdleUpdates = false;
|
||||
bool ret = m_proxy->compositeAndReadback(pixels, rect);
|
||||
|
@ -40,7 +40,6 @@ struct hash<WebKit::WebGraphicsContext3D*> {
|
||||
namespace cc {
|
||||
|
||||
class FontAtlas;
|
||||
class IntRect;
|
||||
class Layer;
|
||||
class LayerTreeHostImpl;
|
||||
class LayerTreeHostImplClient;
|
||||
@ -141,7 +140,7 @@ public:
|
||||
// Composites and attempts to read back the result into the provided
|
||||
// buffer. If it wasn't possible, e.g. due to context lost, will return
|
||||
// false.
|
||||
bool compositeAndReadback(void *pixels, const IntRect&);
|
||||
bool compositeAndReadback(void *pixels, const gfx::Rect&);
|
||||
|
||||
void finishAllRendering();
|
||||
|
||||
|
@ -105,38 +105,34 @@ gfx::RectF PinchZoomViewport::bounds() const
|
||||
return bounds;
|
||||
}
|
||||
|
||||
FloatSize PinchZoomViewport::applyScroll(FloatSize& delta)
|
||||
FloatSize PinchZoomViewport::applyScroll(const gfx::Vector2dF& delta)
|
||||
{
|
||||
FloatSize overflow;
|
||||
FloatRect pinchedBounds = cc::FloatRect(bounds());
|
||||
gfx::Vector2dF overflow;
|
||||
gfx::RectF pinchedBounds = bounds();
|
||||
|
||||
pinchedBounds.move(delta);
|
||||
pinchedBounds.Offset(delta);
|
||||
if (pinchedBounds.x() < 0) {
|
||||
overflow.setWidth(pinchedBounds.x());
|
||||
pinchedBounds.setX(0);
|
||||
overflow.set_x(pinchedBounds.x());
|
||||
pinchedBounds.set_x(0);
|
||||
}
|
||||
|
||||
if (pinchedBounds.y() < 0) {
|
||||
overflow.setHeight(pinchedBounds.y());
|
||||
pinchedBounds.setY(0);
|
||||
overflow.set_y(pinchedBounds.y());
|
||||
pinchedBounds.set_y(0);
|
||||
}
|
||||
|
||||
if (pinchedBounds.maxX() > m_layoutViewportSize.width()) {
|
||||
overflow.setWidth(
|
||||
pinchedBounds.maxX() - m_layoutViewportSize.width());
|
||||
pinchedBounds.move(
|
||||
m_layoutViewportSize.width() - pinchedBounds.maxX(), 0);
|
||||
if (pinchedBounds.right() > m_layoutViewportSize.width()) {
|
||||
overflow.set_x(pinchedBounds.right() - m_layoutViewportSize.width());
|
||||
pinchedBounds.Offset(m_layoutViewportSize.width() - pinchedBounds.right(), 0);
|
||||
}
|
||||
|
||||
if (pinchedBounds.maxY() > m_layoutViewportSize.height()) {
|
||||
overflow.setHeight(
|
||||
pinchedBounds.maxY() - m_layoutViewportSize.height());
|
||||
pinchedBounds.move(
|
||||
0, m_layoutViewportSize.height() - pinchedBounds.maxY());
|
||||
if (pinchedBounds.bottom() > m_layoutViewportSize.height()) {
|
||||
overflow.set_y(pinchedBounds.bottom() - m_layoutViewportSize.height());
|
||||
pinchedBounds.Offset(0, m_layoutViewportSize.height() - pinchedBounds.bottom());
|
||||
}
|
||||
m_pinchViewportScrollDelta = pinchedBounds.location();
|
||||
m_pinchViewportScrollDelta = cc::FloatPoint(pinchedBounds.origin());
|
||||
|
||||
return overflow;
|
||||
return cc::FloatSize(overflow);
|
||||
}
|
||||
|
||||
WebTransformationMatrix PinchZoomViewport::implTransform() const
|
||||
@ -691,7 +687,7 @@ void LayerTreeHostImpl::drawLayers(const FrameData& frame)
|
||||
// Once a RenderPass has been drawn, its damage should be cleared in
|
||||
// case the RenderPass will be reused next frame.
|
||||
for (unsigned int i = 0; i < frame.renderPasses.size(); i++)
|
||||
frame.renderPasses[i]->setDamageRect(FloatRect());
|
||||
frame.renderPasses[i]->setDamageRect(gfx::RectF());
|
||||
|
||||
// The next frame should start by assuming nothing has changed, and changes are noted as they occur.
|
||||
for (unsigned int i = 0; i < frame.renderSurfaceLayerList->size(); i++)
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
// Apply the scroll offset in layout space to the offset of the pinch-zoom viewport. The viewport cannot be
|
||||
// scrolled outside of the layout viewport bounds. Returns the component of the scroll that is un-applied due to
|
||||
// this constraint.
|
||||
FloatSize applyScroll(FloatSize&);
|
||||
FloatSize applyScroll(const gfx::Vector2dF&);
|
||||
|
||||
WebKit::WebTransformationMatrix implTransform() const;
|
||||
|
||||
|
@ -434,7 +434,7 @@ TEST_P(LayerTreeHostImplTest, nonFastScrollableRegionBasic)
|
||||
initializeRendererAndDrawFrame();
|
||||
LayerImpl* root = m_hostImpl->rootLayer();
|
||||
|
||||
root->setNonFastScrollableRegion(IntRect(0, 0, 50, 50));
|
||||
root->setNonFastScrollableRegion(gfx::Rect(0, 0, 50, 50));
|
||||
|
||||
// All scroll types inside the non-fast scrollable region should fail.
|
||||
EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(25, 25), InputHandlerClient::Wheel), InputHandlerClient::ScrollOnMainThread);
|
||||
@ -455,7 +455,7 @@ TEST_P(LayerTreeHostImplTest, nonFastScrollableRegionWithOffset)
|
||||
m_hostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
|
||||
LayerImpl* root = m_hostImpl->rootLayer();
|
||||
|
||||
root->setNonFastScrollableRegion(IntRect(0, 0, 50, 50));
|
||||
root->setNonFastScrollableRegion(gfx::Rect(0, 0, 50, 50));
|
||||
root->setPosition(gfx::PointF(-25, 0));
|
||||
initializeRendererAndDrawFrame();
|
||||
|
||||
|
@ -314,7 +314,7 @@ public:
|
||||
m_layerTreeHost->setViewportSize(gfx::Size(0, 0), gfx::Size(0, 0));
|
||||
|
||||
scoped_array<char> pixels(new char[4]);
|
||||
m_layerTreeHost->compositeAndReadback(static_cast<void*>(pixels.get()), IntRect(0, 0, 1, 1));
|
||||
m_layerTreeHost->compositeAndReadback(static_cast<void*>(pixels.get()), gfx::Rect(0, 0, 1, 1));
|
||||
} else if (m_numCommits == 2) {
|
||||
m_layerTreeHost->setNeedsRedraw();
|
||||
m_layerTreeHost->setNeedsCommit();
|
||||
@ -439,7 +439,7 @@ public:
|
||||
m_layerTreeHost->setNeedsCommit();
|
||||
m_layerTreeHost->setNeedsCommit();
|
||||
scoped_array<char> pixels(new char[4]);
|
||||
m_layerTreeHost->compositeAndReadback(static_cast<void*>(pixels.get()), IntRect(0, 0, 1, 1));
|
||||
m_layerTreeHost->compositeAndReadback(static_cast<void*>(pixels.get()), gfx::Rect(0, 0, 1, 1));
|
||||
} else
|
||||
endTest();
|
||||
|
||||
@ -1923,13 +1923,13 @@ public:
|
||||
m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max());
|
||||
m_layerTreeHost->commitComplete();
|
||||
|
||||
EXPECT_RECT_EQ(cc::IntRect(), child2->occludedScreenSpace().bounds());
|
||||
EXPECT_RECT_EQ(gfx::Rect(), child2->occludedScreenSpace().bounds());
|
||||
EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size());
|
||||
EXPECT_RECT_EQ(cc::IntRect(), grandChild->occludedScreenSpace().bounds());
|
||||
EXPECT_RECT_EQ(gfx::Rect(), grandChild->occludedScreenSpace().bounds());
|
||||
EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size());
|
||||
EXPECT_RECT_EQ(cc::IntRect(30, 40, 170, 160), child->occludedScreenSpace().bounds());
|
||||
EXPECT_RECT_EQ(gfx::Rect(30, 40, 170, 160), child->occludedScreenSpace().bounds());
|
||||
EXPECT_EQ(1u, child->occludedScreenSpace().rects().size());
|
||||
EXPECT_RECT_EQ(cc::IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace().bounds());
|
||||
EXPECT_RECT_EQ(gfx::Rect(10, 70, 190, 130), rootLayer->occludedScreenSpace().bounds());
|
||||
EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size());
|
||||
|
||||
// Kill the layerTreeHost immediately.
|
||||
@ -1986,7 +1986,7 @@ public:
|
||||
m_layerTreeHost->commitComplete();
|
||||
|
||||
for (int i = 0; i < numSurfaces-1; ++i) {
|
||||
cc::IntRect expectedOcclusion(i+1, i+1, 200-i-1, 200-i-1);
|
||||
gfx::Rect expectedOcclusion(i+1, i+1, 200-i-1, 200-i-1);
|
||||
|
||||
EXPECT_RECT_EQ(expectedOcclusion, layers[i]->occludedScreenSpace().bounds());
|
||||
EXPECT_EQ(1u, layers[i]->occludedScreenSpace().rects().size());
|
||||
@ -2522,7 +2522,7 @@ public:
|
||||
Layer* rootLayer = m_layerTreeHost->rootLayer();
|
||||
|
||||
scoped_array<char> pixels(new char[4]);
|
||||
m_layerTreeHost->compositeAndReadback(static_cast<void*>(pixels.get()), IntRect(0, 0, 1, 1));
|
||||
m_layerTreeHost->compositeAndReadback(static_cast<void*>(pixels.get()), gfx::Rect(0, 0, 1, 1));
|
||||
EXPECT_FALSE(rootLayer->renderSurface());
|
||||
|
||||
endTest();
|
||||
|
@ -509,7 +509,7 @@ TEST_F(LayerTest, checkPropertyChangeCausesCorrectBehavior)
|
||||
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setSublayerTransform(WebTransformationMatrix(0, 0, 0, 0, 0, 0)));
|
||||
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setScrollable(true));
|
||||
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setShouldScrollOnMainThread(true));
|
||||
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setNonFastScrollableRegion(Region(IntRect(1, 1, 2, 2))));
|
||||
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setNonFastScrollableRegion(gfx::Rect(1, 1, 2, 2)));
|
||||
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setHaveWheelEventHandlers(true));
|
||||
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setScrollPosition(IntPoint(10, 10)));
|
||||
EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setTransform(WebTransformationMatrix(0, 0, 0, 0, 0, 0)));
|
||||
|
@ -197,7 +197,7 @@ gfx::RectF MathUtil::computeEnclosingClippedRect(const HomogeneousCoordinate& h1
|
||||
bool somethingClipped = h1.shouldBeClipped() || h2.shouldBeClipped() || h3.shouldBeClipped() || h4.shouldBeClipped();
|
||||
if (!somethingClipped) {
|
||||
FloatQuad mappedQuad = FloatQuad(h1.cartesianPoint2d(), h2.cartesianPoint2d(), h3.cartesianPoint2d(), h4.cartesianPoint2d());
|
||||
return cc::FloatRect(mappedQuad.boundingBox());
|
||||
return mappedQuad.boundingBox();
|
||||
}
|
||||
|
||||
bool everythingClipped = h1.shouldBeClipped() && h2.shouldBeClipped() && h3.shouldBeClipped() && h4.shouldBeClipped();
|
||||
|
@ -135,7 +135,7 @@ static inline Region transformSurfaceOpaqueRegion(const RenderSurfaceType* surfa
|
||||
gfx::Rect transformedRect = gfx::ToEnclosedRect(MathUtil::mapClippedRect(transform, cc::FloatRect(rects[i])));
|
||||
if (!surface->clipRect().IsEmpty())
|
||||
transformedRect.Intersect(surface->clipRect());
|
||||
transformedRegion.unite(cc::IntRect(transformedRect));
|
||||
transformedRegion.Union(transformedRect);
|
||||
}
|
||||
return transformedRegion;
|
||||
}
|
||||
@ -145,10 +145,10 @@ static inline void reduceOcclusion(const gfx::Rect& affectedArea, const gfx::Rec
|
||||
if (affectedArea.IsEmpty())
|
||||
return;
|
||||
|
||||
Region affectedOcclusion = intersect(occlusion, cc::IntRect(affectedArea));
|
||||
Region affectedOcclusion = intersect(occlusion, affectedArea);
|
||||
Vector<WebCore::IntRect> affectedOcclusionRects = affectedOcclusion.rects();
|
||||
|
||||
occlusion.subtract(cc::IntRect(affectedArea));
|
||||
occlusion.Subtract(affectedArea);
|
||||
for (size_t j = 0; j < affectedOcclusionRects.size(); ++j) {
|
||||
WebCore::IntRect& occlusionRect = affectedOcclusionRects[j];
|
||||
|
||||
@ -174,7 +174,7 @@ static inline void reduceOcclusion(const gfx::Rect& affectedArea, const gfx::Rec
|
||||
occlusionRect.move(shrinkLeft, shrinkTop);
|
||||
occlusionRect.contract(shrinkLeft + shrinkRight, shrinkTop + shrinkBottom);
|
||||
|
||||
occlusion.unite(occlusionRect);
|
||||
occlusion.Union(occlusionRect);
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ static void reduceOcclusionBelowSurface(LayerType* contributingLayer, const gfx:
|
||||
if (surfaceRect.IsEmpty())
|
||||
return;
|
||||
|
||||
gfx::Rect boundsInTarget = gfx::ToEnclosingRect(MathUtil::mapClippedRect(surfaceTransform, cc::FloatRect(surfaceRect)));
|
||||
gfx::Rect boundsInTarget = gfx::ToEnclosingRect(MathUtil::mapClippedRect(surfaceTransform, gfx::RectF(surfaceRect)));
|
||||
if (!contributingLayer->renderSurface()->clipRect().IsEmpty())
|
||||
boundsInTarget.Intersect(contributingLayer->renderSurface()->clipRect());
|
||||
|
||||
@ -194,10 +194,10 @@ static void reduceOcclusionBelowSurface(LayerType* contributingLayer, const gfx:
|
||||
// The filter can move pixels from outside of the clip, so allow affectedArea to expand outside the clip.
|
||||
boundsInTarget.Inset(-outsetLeft, -outsetTop, -outsetRight, -outsetBottom);
|
||||
|
||||
gfx::Rect boundsInScreen = gfx::ToEnclosingRect(MathUtil::mapClippedRect(renderTarget->renderSurface()->screenSpaceTransform(), cc::FloatRect(boundsInTarget)));
|
||||
gfx::Rect boundsInScreen = gfx::ToEnclosingRect(MathUtil::mapClippedRect(renderTarget->renderSurface()->screenSpaceTransform(), gfx::RectF(boundsInTarget)));
|
||||
|
||||
gfx::Rect filterOutsetsInTarget(-outsetLeft, -outsetTop, outsetLeft + outsetRight, outsetTop + outsetBottom);
|
||||
gfx::Rect filterOutsetsInScreen = gfx::ToEnclosingRect(MathUtil::mapClippedRect(renderTarget->renderSurface()->screenSpaceTransform(), cc::FloatRect(filterOutsetsInTarget)));
|
||||
gfx::Rect filterOutsetsInScreen = gfx::ToEnclosingRect(MathUtil::mapClippedRect(renderTarget->renderSurface()->screenSpaceTransform(), gfx::RectF(filterOutsetsInTarget)));
|
||||
|
||||
reduceOcclusion(boundsInTarget, filterOutsetsInTarget, occlusionInTarget);
|
||||
reduceOcclusion(boundsInScreen, filterOutsetsInScreen, occlusionInScreen);
|
||||
@ -216,7 +216,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::leaveToRenderTarget(con
|
||||
const RenderSurfaceType* oldSurface = oldTarget->renderSurface();
|
||||
Region oldTargetOcclusionInNewTarget = transformSurfaceOpaqueRegion<RenderSurfaceType>(oldSurface, m_stack[lastIndex].occlusionInTarget, oldSurface->drawTransform());
|
||||
if (oldTarget->hasReplica() && !oldTarget->replicaHasMask())
|
||||
oldTargetOcclusionInNewTarget.unite(transformSurfaceOpaqueRegion<RenderSurfaceType>(oldSurface, m_stack[lastIndex].occlusionInTarget, oldSurface->replicaDrawTransform()));
|
||||
oldTargetOcclusionInNewTarget.Union(transformSurfaceOpaqueRegion<RenderSurfaceType>(oldSurface, m_stack[lastIndex].occlusionInTarget, oldSurface->replicaDrawTransform()));
|
||||
|
||||
gfx::Rect unoccludedSurfaceRect;
|
||||
gfx::Rect unoccludedReplicaRect;
|
||||
@ -228,8 +228,8 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::leaveToRenderTarget(con
|
||||
|
||||
if (surfaceWillBeAtTopAfterPop) {
|
||||
// Merge the top of the stack down.
|
||||
m_stack[lastIndex - 1].occlusionInScreen.unite(m_stack[lastIndex].occlusionInScreen);
|
||||
m_stack[lastIndex - 1].occlusionInTarget.unite(oldTargetOcclusionInNewTarget);
|
||||
m_stack[lastIndex - 1].occlusionInScreen.Union(m_stack[lastIndex].occlusionInScreen);
|
||||
m_stack[lastIndex - 1].occlusionInTarget.Union(oldTargetOcclusionInNewTarget);
|
||||
m_stack.removeLast();
|
||||
} else {
|
||||
// Replace the top of the stack with the new pushed surface. Copy the occluded screen region to the top.
|
||||
@ -248,7 +248,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::leaveToRenderTarget(con
|
||||
template<typename LayerType>
|
||||
static inline void addOcclusionBehindLayer(Region& region, const LayerType* layer, const WebTransformationMatrix& transform, const Region& opaqueContents, const gfx::Rect& clipRectInTarget, const gfx::Size& minimumTrackingSize, std::vector<gfx::Rect>* occludingScreenSpaceRects)
|
||||
{
|
||||
DCHECK(layer->visibleContentRect().Contains(cc::IntRect(opaqueContents.bounds())));
|
||||
DCHECK(layer->visibleContentRect().Contains(opaqueContents.bounds()));
|
||||
|
||||
bool clipped;
|
||||
FloatQuad visibleTransformedQuad = MathUtil::mapQuad(transform, FloatQuad(layer->visibleContentRect()), clipped);
|
||||
@ -264,7 +264,7 @@ static inline void addOcclusionBehindLayer(Region& region, const LayerType* laye
|
||||
if (transformedRect.width() >= minimumTrackingSize.width() || transformedRect.height() >= minimumTrackingSize.height()) {
|
||||
if (occludingScreenSpaceRects)
|
||||
occludingScreenSpaceRects->push_back(transformedRect);
|
||||
region.unite(cc::IntRect(transformedRect));
|
||||
region.Union(transformedRect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -284,7 +284,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::markOccludedBehindLayer
|
||||
return;
|
||||
|
||||
Region opaqueContents = layer->visibleContentOpaqueRegion();
|
||||
if (opaqueContents.isEmpty())
|
||||
if (opaqueContents.IsEmpty())
|
||||
return;
|
||||
|
||||
gfx::Rect clipRectInTarget = layerClipRectInTarget(layer);
|
||||
@ -297,7 +297,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::markOccludedBehindLayer
|
||||
if (layerTransformsToScreenKnown(layer)) {
|
||||
WebTransformationMatrix targetToScreenTransform = m_stack.last().target->renderSurface()->screenSpaceTransform();
|
||||
bool clipped;
|
||||
FloatQuad clipQuadInScreen = MathUtil::mapQuad(targetToScreenTransform, FloatQuad(FloatRect(clipRectInTarget)), clipped);
|
||||
FloatQuad clipQuadInScreen = MathUtil::mapQuad(targetToScreenTransform, FloatQuad(clipRectInTarget), clipped);
|
||||
// FIXME: Find a rect interior to the transformed clip quad.
|
||||
if (clipped || !clipQuadInScreen.isRectilinear())
|
||||
return;
|
||||
@ -311,7 +311,7 @@ static inline bool testContentRectOccluded(const gfx::Rect& contentRect, const W
|
||||
gfx::RectF transformedRect = MathUtil::mapClippedRect(contentSpaceTransform, gfx::RectF(contentRect));
|
||||
// Take the gfx::ToEnclosingRect, as we want to include partial pixels in the test.
|
||||
gfx::Rect targetRect = gfx::IntersectRects(gfx::ToEnclosingRect(transformedRect), clipRectInTarget);
|
||||
return targetRect.IsEmpty() || occlusion.contains(cc::IntRect(targetRect));
|
||||
return targetRect.IsEmpty() || occlusion.Contains(targetRect);
|
||||
}
|
||||
|
||||
template<typename LayerType, typename RenderSurfaceType>
|
||||
@ -346,10 +346,9 @@ bool OcclusionTrackerBase<LayerType, RenderSurfaceType>::occluded(const LayerTyp
|
||||
// the resulting unoccluded region is not rectangular, we return a rect containing it.
|
||||
static inline gfx::Rect rectSubtractRegion(const gfx::Rect& rect, const Region& region)
|
||||
{
|
||||
cc::IntRect intRect(rect);
|
||||
Region rectRegion(intRect);
|
||||
rectRegion.subtract(region);
|
||||
return cc::IntRect(rectRegion.bounds());
|
||||
Region rectRegion(rect);
|
||||
rectRegion.Subtract(region);
|
||||
return rectRegion.bounds();
|
||||
}
|
||||
|
||||
static inline gfx::Rect computeUnoccludedContentRect(const gfx::Rect& contentRect, const WebTransformationMatrix& contentSpaceTransform, const gfx::Rect& clipRectInTarget, const Region& occlusion)
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
OverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get(); }
|
||||
|
||||
// Gives the region of the screen that is not occluded by something opaque.
|
||||
Region computeVisibleRegionInScreen() const { return subtract(Region(cc::IntRect(m_rootTargetRect)), m_stack.last().occlusionInScreen); }
|
||||
Region computeVisibleRegionInScreen() const { return subtract(Region(m_rootTargetRect), m_stack.last().occlusionInScreen); }
|
||||
|
||||
void setMinimumTrackingSize(const gfx::Size& size) { m_minimumTrackingSize = size; }
|
||||
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
virtual Region visibleContentOpaqueRegion() const OVERRIDE
|
||||
{
|
||||
if (m_overrideOpaqueContentsRect)
|
||||
return cc::IntRect(gfx::IntersectRects(m_opaqueContentsRect, visibleContentRect()));
|
||||
return gfx::IntersectRects(m_opaqueContentsRect, visibleContentRect());
|
||||
return Layer::visibleContentOpaqueRegion();
|
||||
}
|
||||
void setOpaqueContentsRect(const gfx::Rect& opaqueContentsRect)
|
||||
@ -71,7 +71,7 @@ public:
|
||||
virtual Region visibleContentOpaqueRegion() const OVERRIDE
|
||||
{
|
||||
if (m_overrideOpaqueContentsRect)
|
||||
return cc::IntRect(gfx::IntersectRects(m_opaqueContentsRect, visibleContentRect()));
|
||||
return gfx::IntersectRects(m_opaqueContentsRect, visibleContentRect());
|
||||
return LayerImpl::visibleContentOpaqueRegion();
|
||||
}
|
||||
void setOpaqueContentsRect(const gfx::Rect& opaqueContentsRect)
|
||||
@ -200,7 +200,7 @@ protected:
|
||||
LayerTreeHost::setNeedsFilterContext(false);
|
||||
}
|
||||
|
||||
typename Types::ContentLayerType* createRoot(const WebTransformationMatrix& transform, const FloatPoint& position, const gfx::Size& bounds)
|
||||
typename Types::ContentLayerType* createRoot(const WebTransformationMatrix& transform, const gfx::PointF& position, const gfx::Size& bounds)
|
||||
{
|
||||
typename Types::ContentLayerPtrType layer(Types::createContentLayer());
|
||||
typename Types::ContentLayerType* layerPtr = layer.get();
|
||||
@ -211,7 +211,7 @@ protected:
|
||||
return layerPtr;
|
||||
}
|
||||
|
||||
typename Types::LayerType* createLayer(typename Types::LayerType* parent, const WebTransformationMatrix& transform, const FloatPoint& position, const gfx::Size& bounds)
|
||||
typename Types::LayerType* createLayer(typename Types::LayerType* parent, const WebTransformationMatrix& transform, const gfx::PointF& position, const gfx::Size& bounds)
|
||||
{
|
||||
typename Types::LayerPtrType layer(Types::createLayer());
|
||||
typename Types::LayerType* layerPtr = layer.get();
|
||||
@ -220,7 +220,7 @@ protected:
|
||||
return layerPtr;
|
||||
}
|
||||
|
||||
typename Types::LayerType* createSurface(typename Types::LayerType* parent, const WebTransformationMatrix& transform, const FloatPoint& position, const gfx::Size& bounds)
|
||||
typename Types::LayerType* createSurface(typename Types::LayerType* parent, const WebTransformationMatrix& transform, const gfx::PointF& position, const gfx::Size& bounds)
|
||||
{
|
||||
typename Types::LayerType* layer = createLayer(parent, transform, position, bounds);
|
||||
WebFilterOperations filters;
|
||||
@ -229,7 +229,7 @@ protected:
|
||||
return layer;
|
||||
}
|
||||
|
||||
typename Types::ContentLayerType* createDrawingLayer(typename Types::LayerType* parent, const WebTransformationMatrix& transform, const FloatPoint& position, const gfx::Size& bounds, bool opaque)
|
||||
typename Types::ContentLayerType* createDrawingLayer(typename Types::LayerType* parent, const WebTransformationMatrix& transform, const gfx::PointF& position, const gfx::Size& bounds, bool opaque)
|
||||
{
|
||||
typename Types::ContentLayerPtrType layer(Types::createContentLayer());
|
||||
typename Types::ContentLayerType* layerPtr = layer.get();
|
||||
@ -249,7 +249,7 @@ protected:
|
||||
return layerPtr;
|
||||
}
|
||||
|
||||
typename Types::LayerType* createReplicaLayer(typename Types::LayerType* owningLayer, const WebTransformationMatrix& transform, const FloatPoint& position, const gfx::Size& bounds)
|
||||
typename Types::LayerType* createReplicaLayer(typename Types::LayerType* owningLayer, const WebTransformationMatrix& transform, const gfx::PointF& position, const gfx::Size& bounds)
|
||||
{
|
||||
typename Types::ContentLayerPtrType layer(Types::createContentLayer());
|
||||
typename Types::ContentLayerType* layerPtr = layer.get();
|
||||
@ -262,12 +262,12 @@ protected:
|
||||
{
|
||||
typename Types::ContentLayerPtrType layer(Types::createContentLayer());
|
||||
typename Types::ContentLayerType* layerPtr = layer.get();
|
||||
setProperties(layerPtr, identityMatrix, FloatPoint(), bounds);
|
||||
setProperties(layerPtr, identityMatrix, gfx::PointF(), bounds);
|
||||
setMask(owningLayer, Types::passLayerPtr(layer));
|
||||
return layerPtr;
|
||||
}
|
||||
|
||||
typename Types::ContentLayerType* createDrawingSurface(typename Types::LayerType* parent, const WebTransformationMatrix& transform, const FloatPoint& position, const gfx::Size& bounds, bool opaque)
|
||||
typename Types::ContentLayerType* createDrawingSurface(typename Types::LayerType* parent, const WebTransformationMatrix& transform, const gfx::PointF& position, const gfx::Size& bounds, bool opaque)
|
||||
{
|
||||
typename Types::ContentLayerType* layer = createDrawingLayer(parent, transform, position, bounds, opaque);
|
||||
WebFilterOperations filters;
|
||||
@ -355,21 +355,21 @@ protected:
|
||||
const WebTransformationMatrix identityMatrix;
|
||||
|
||||
private:
|
||||
void setBaseProperties(typename Types::LayerType* layer, const WebTransformationMatrix& transform, const FloatPoint& position, const gfx::Size& bounds)
|
||||
void setBaseProperties(typename Types::LayerType* layer, const WebTransformationMatrix& transform, const gfx::PointF& position, const gfx::Size& bounds)
|
||||
{
|
||||
layer->setTransform(transform);
|
||||
layer->setSublayerTransform(WebTransformationMatrix());
|
||||
layer->setAnchorPoint(FloatPoint(0, 0));
|
||||
layer->setAnchorPoint(gfx::PointF(0, 0));
|
||||
layer->setPosition(position);
|
||||
layer->setBounds(bounds);
|
||||
}
|
||||
|
||||
void setProperties(Layer* layer, const WebTransformationMatrix& transform, const FloatPoint& position, const gfx::Size& bounds)
|
||||
void setProperties(Layer* layer, const WebTransformationMatrix& transform, const gfx::PointF& position, const gfx::Size& bounds)
|
||||
{
|
||||
setBaseProperties(layer, transform, position, bounds);
|
||||
}
|
||||
|
||||
void setProperties(LayerImpl* layer, const WebTransformationMatrix& transform, const FloatPoint& position, const gfx::Size& bounds)
|
||||
void setProperties(LayerImpl* layer, const WebTransformationMatrix& transform, const gfx::PointF& position, const gfx::Size& bounds)
|
||||
{
|
||||
setBaseProperties(layer, transform, position, bounds);
|
||||
|
||||
@ -461,8 +461,8 @@ protected:
|
||||
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(30, 30), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(30, 30), gfx::Size(500, 500), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -513,9 +513,9 @@ protected:
|
||||
WebTransformationMatrix layerTransform;
|
||||
layerTransform.translate(10, 10);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(100, 100));
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(parent, layerTransform, FloatPoint(0, 0), IntSize(90, 90), true);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(layer1, layerTransform, FloatPoint(0, 0), IntSize(50, 50), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::Point(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(parent, layerTransform, gfx::PointF(0, 0), gfx::Size(90, 90), true);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(layer1, layerTransform, gfx::PointF(0, 0), gfx::Size(50, 50), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -557,8 +557,8 @@ protected:
|
||||
layerTransform.rotate(90);
|
||||
layerTransform.translate(-250, -250);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, layerTransform, FloatPoint(30, 30), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, layerTransform, gfx::PointF(30, 30), gfx::Size(500, 500), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -609,8 +609,8 @@ protected:
|
||||
WebTransformationMatrix layerTransform;
|
||||
layerTransform.translate(20, 20);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, layerTransform, FloatPoint(30, 30), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, layerTransform, gfx::PointF(30, 30), gfx::Size(500, 500), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -675,11 +675,11 @@ protected:
|
||||
childTransform.rotate(90);
|
||||
childTransform.translate(-250, -250);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::LayerType* child = this->createLayer(parent, childTransform, FloatPoint(30, 30), gfx::Size(500, 500));
|
||||
typename Types::LayerType* child = this->createLayer(parent, childTransform, gfx::PointF(30, 30), gfx::Size(500, 500));
|
||||
child->setMasksToBounds(true);
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(child, this->identityMatrix, FloatPoint(10, 10), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(child, this->identityMatrix, gfx::PointF(10, 10), gfx::Size(500, 500), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -752,17 +752,17 @@ protected:
|
||||
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200));
|
||||
|
||||
WebTransformationMatrix layer1Matrix;
|
||||
layer1Matrix.scale(2);
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(parent, layer1Matrix, FloatPoint(0, 0), IntSize(100, 100), true);
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(parent, layer1Matrix, gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
||||
layer1->setForceRenderSurface(true);
|
||||
|
||||
WebTransformationMatrix layer2Matrix;
|
||||
layer2Matrix.translate(25, 25);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(layer1, layer2Matrix, FloatPoint(0, 0), IntSize(50, 50), true);
|
||||
typename Types::ContentLayerType* occluder = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(100, 100), IntSize(500, 500), true);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(layer1, layer2Matrix, gfx::PointF(0, 0), gfx::Size(50, 50), true);
|
||||
typename Types::ContentLayerType* occluder = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(100, 100), gfx::Size(500, 500), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -772,7 +772,7 @@ protected:
|
||||
|
||||
EXPECT_RECT_EQ(gfx::Rect(100, 100, 100, 100), occlusion.occlusionInScreenSpace().bounds());
|
||||
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().IsEmpty());
|
||||
EXPECT_EQ(0u, occlusion.occlusionInTargetSurface().rects().size());
|
||||
|
||||
EXPECT_RECT_EQ(gfx::Rect(0, 0, 25, 25), occlusion.unoccludedLayerContentRect(layer2, gfx::Rect(0, 0, 25, 25)));
|
||||
@ -795,14 +795,14 @@ protected:
|
||||
childTransform.rotate(90);
|
||||
childTransform.translate(-250, -250);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::LayerType* child = this->createLayer(parent, childTransform, FloatPoint(30, 30), gfx::Size(500, 500));
|
||||
typename Types::LayerType* child = this->createLayer(parent, childTransform, gfx::PointF(30, 30), gfx::Size(500, 500));
|
||||
child->setMasksToBounds(true);
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(child, this->identityMatrix, FloatPoint(10, 10), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(child, this->identityMatrix, gfx::PointF(10, 10), gfx::Size(500, 500), true);
|
||||
// |child2| makes |parent|'s surface get considered by OcclusionTracker first, instead of |child|'s. This exercises different code in
|
||||
// leaveToTargetRenderSurface, as the target surface has already been seen.
|
||||
typename Types::ContentLayerType* child2 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(30, 30), gfx::Size(60, 20), true);
|
||||
typename Types::ContentLayerType* child2 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(30, 30), gfx::Size(60, 20), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -911,10 +911,10 @@ protected:
|
||||
WebTransformationMatrix layerTransform;
|
||||
layerTransform.translate(10, 10);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::LayerType* child = this->createLayer(parent, childTransform, FloatPoint(30, 30), gfx::Size(500, 500));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
typename Types::LayerType* child = this->createLayer(parent, childTransform, gfx::PointF(30, 30), gfx::Size(500, 500));
|
||||
child->setMasksToBounds(true);
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(child, layerTransform, FloatPoint(0, 0), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(child, layerTransform, gfx::PointF(0, 0), gfx::Size(500, 500), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -975,12 +975,12 @@ protected:
|
||||
childTransform.rotate(90);
|
||||
childTransform.translate(-250, -250);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::LayerType* child = this->createLayer(parent, childTransform, FloatPoint(30, 30), gfx::Size(500, 500));
|
||||
typename Types::LayerType* child = this->createLayer(parent, childTransform, gfx::PointF(30, 30), gfx::Size(500, 500));
|
||||
child->setMasksToBounds(true);
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(child, this->identityMatrix, FloatPoint(10, 10), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(child, this->identityMatrix, FloatPoint(10, 450), gfx::Size(500, 60), true);
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(child, this->identityMatrix, gfx::PointF(10, 10), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(child, this->identityMatrix, gfx::PointF(10, 450), gfx::Size(500, 60), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1065,12 +1065,12 @@ protected:
|
||||
childTransform.rotate(90);
|
||||
childTransform.translate(-250, -250);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::LayerType* child1 = this->createSurface(parent, childTransform, FloatPoint(30, 30), gfx::Size(10, 10));
|
||||
typename Types::LayerType* child2 = this->createSurface(parent, childTransform, FloatPoint(20, 40), gfx::Size(10, 10));
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(child1, this->identityMatrix, FloatPoint(-10, -10), gfx::Size(510, 510), true);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(child2, this->identityMatrix, FloatPoint(-10, -10), gfx::Size(510, 510), true);
|
||||
typename Types::LayerType* child1 = this->createSurface(parent, childTransform, gfx::PointF(30, 30), gfx::Size(10, 10));
|
||||
typename Types::LayerType* child2 = this->createSurface(parent, childTransform, gfx::PointF(20, 40), gfx::Size(10, 10));
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(child1, this->identityMatrix, gfx::PointF(-10, -10), gfx::Size(510, 510), true);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(child2, this->identityMatrix, gfx::PointF(-10, -10), gfx::Size(510, 510), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1181,12 +1181,12 @@ protected:
|
||||
child2Transform.rotate(90);
|
||||
child2Transform.translate(-250, -250);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::LayerType* child1 = this->createSurface(parent, child1Transform, FloatPoint(30, 20), gfx::Size(10, 10));
|
||||
typename Types::LayerType* child2 = this->createDrawingSurface(parent, child2Transform, FloatPoint(20, 40), gfx::Size(10, 10), false);
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(child1, this->identityMatrix, FloatPoint(-10, -20), gfx::Size(510, 510), true);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(child2, this->identityMatrix, FloatPoint(-10, -10), gfx::Size(510, 510), true);
|
||||
typename Types::LayerType* child1 = this->createSurface(parent, child1Transform, gfx::PointF(30, 20), gfx::Size(10, 10));
|
||||
typename Types::LayerType* child2 = this->createDrawingSurface(parent, child2Transform, gfx::PointF(20, 40), gfx::Size(10, 10), false);
|
||||
typename Types::ContentLayerType* layer1 = this->createDrawingLayer(child1, this->identityMatrix, gfx::PointF(-10, -20), gfx::Size(510, 510), true);
|
||||
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(child2, this->identityMatrix, gfx::PointF(-10, -10), gfx::Size(510, 510), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1285,11 +1285,11 @@ protected:
|
||||
layerTransform.rotate(90);
|
||||
layerTransform.translate(-250, -250);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::ContentLayerType* blurLayer = this->createDrawingLayer(parent, layerTransform, FloatPoint(30, 30), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* opaqueLayer = this->createDrawingLayer(parent, layerTransform, FloatPoint(30, 30), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* opacityLayer = this->createDrawingLayer(parent, layerTransform, FloatPoint(30, 30), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* blurLayer = this->createDrawingLayer(parent, layerTransform, gfx::PointF(30, 30), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* opaqueLayer = this->createDrawingLayer(parent, layerTransform, gfx::PointF(30, 30), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* opacityLayer = this->createDrawingLayer(parent, layerTransform, gfx::PointF(30, 30), gfx::Size(500, 500), true);
|
||||
|
||||
WebFilterOperations filters;
|
||||
filters.append(WebFilterOperation::createBlurFilter(10));
|
||||
@ -1312,13 +1312,13 @@ protected:
|
||||
this->visitLayer(opacityLayer, occlusion);
|
||||
this->enterContributingSurface(opacityLayer, occlusion);
|
||||
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().IsEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().IsEmpty());
|
||||
|
||||
// And has nothing to contribute to its parent surface.
|
||||
this->leaveContributingSurface(opacityLayer, occlusion);
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().IsEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().IsEmpty());
|
||||
|
||||
// Opaque layer will contribute to occlusion.
|
||||
this->visitLayer(opaqueLayer, occlusion);
|
||||
@ -1338,14 +1338,14 @@ protected:
|
||||
|
||||
// The blur layer needs to throw away any occlusion from outside its subtree.
|
||||
this->enterLayer(blurLayer, occlusion);
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().IsEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().IsEmpty());
|
||||
|
||||
// And it won't contribute to occlusion.
|
||||
this->leaveLayer(blurLayer, occlusion);
|
||||
this->enterContributingSurface(blurLayer, occlusion);
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().IsEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().IsEmpty());
|
||||
|
||||
// But the opaque layer's occlusion is preserved on the parent.
|
||||
this->leaveContributingSurface(blurLayer, occlusion);
|
||||
@ -1365,9 +1365,9 @@ protected:
|
||||
OcclusionTrackerTestReplicaDoesOcclude(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 100), gfx::Size(50, 50), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, FloatPoint(50, 50), gfx::Size());
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(50, 50), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, gfx::PointF(50, 50), gfx::Size());
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1397,10 +1397,10 @@ protected:
|
||||
OcclusionTrackerTestReplicaWithClipping(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 170));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 170));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 100), gfx::Size(50, 50), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, FloatPoint(50, 50), gfx::Size());
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(50, 50), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, gfx::PointF(50, 50), gfx::Size());
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1430,9 +1430,9 @@ protected:
|
||||
OcclusionTrackerTestReplicaWithMask(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 100), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* replica = this->createReplicaLayer(surface, this->identityMatrix, FloatPoint(50, 50), gfx::Size());
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* replica = this->createReplicaLayer(surface, this->identityMatrix, gfx::PointF(50, 50), gfx::Size());
|
||||
this->createMaskLayer(replica, gfx::Size(10, 10));
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
@ -1463,8 +1463,8 @@ protected:
|
||||
OcclusionTrackerTestLayerClipRectOutsideChild(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1508,8 +1508,8 @@ protected:
|
||||
OcclusionTrackerTestViewportRectOutsideChild(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(200, 100, 100, 100));
|
||||
@ -1553,8 +1553,8 @@ protected:
|
||||
OcclusionTrackerTestLayerClipRectOverChild(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1593,8 +1593,8 @@ protected:
|
||||
OcclusionTrackerTestViewportRectOverChild(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(100, 100, 100, 100));
|
||||
@ -1633,8 +1633,8 @@ protected:
|
||||
OcclusionTrackerTestLayerClipRectPartlyOverChild(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1677,8 +1677,8 @@ protected:
|
||||
OcclusionTrackerTestViewportRectPartlyOverChild(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(50, 50, 200, 200));
|
||||
@ -1721,8 +1721,8 @@ protected:
|
||||
OcclusionTrackerTestLayerClipRectOverNothing(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1765,8 +1765,8 @@ protected:
|
||||
OcclusionTrackerTestViewportRectOverNothing(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(500, 500, 100, 100));
|
||||
@ -1809,8 +1809,8 @@ protected:
|
||||
OcclusionTrackerTestLayerClipRectForLayerOffOrigin(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1834,8 +1834,8 @@ protected:
|
||||
OcclusionTrackerTestOpaqueContentsRegionEmpty(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 200), false);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 200), false);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1858,7 +1858,7 @@ protected:
|
||||
this->visitContributingSurface(layer, occlusion);
|
||||
this->enterLayer(parent, occlusion);
|
||||
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().bounds().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().bounds().IsEmpty());
|
||||
EXPECT_EQ(0u, occlusion.occlusionInScreenSpace().rects().size());
|
||||
}
|
||||
};
|
||||
@ -1871,8 +1871,8 @@ protected:
|
||||
OcclusionTrackerTestOpaqueContentsRegionNonEmpty(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(100, 100), gfx::Size(200, 200), false);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(100, 100), gfx::Size(200, 200), false);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
{
|
||||
@ -1936,9 +1936,9 @@ protected:
|
||||
WebTransformationMatrix transform;
|
||||
transform.rotate3d(0, 30, 0);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::LayerType* container = this->createLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(container, transform, FloatPoint(100, 100), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::LayerType* container = this->createLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(container, transform, gfx::PointF(100, 100), gfx::Size(200, 200), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -1969,21 +1969,21 @@ protected:
|
||||
WebTransformationMatrix translationToBack;
|
||||
translationToFront.translate3d(0, 0, -100);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* child1 = this->createDrawingLayer(parent, translationToBack, FloatPoint(0, 0), gfx::Size(100, 100), true);
|
||||
typename Types::ContentLayerType* child2 = this->createDrawingLayer(parent, translationToFront, FloatPoint(50, 50), gfx::Size(100, 100), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* child1 = this->createDrawingLayer(parent, translationToBack, gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
||||
typename Types::ContentLayerType* child2 = this->createDrawingLayer(parent, translationToFront, gfx::PointF(50, 50), gfx::Size(100, 100), true);
|
||||
parent->setPreserves3D(true);
|
||||
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
this->visitLayer(child2, occlusion);
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().IsEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().IsEmpty());
|
||||
|
||||
this->visitLayer(child1, occlusion);
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInScreenSpace().IsEmpty());
|
||||
EXPECT_TRUE(occlusion.occlusionInTargetSurface().IsEmpty());
|
||||
}
|
||||
};
|
||||
|
||||
@ -2002,9 +2002,9 @@ protected:
|
||||
transform.rotate3d(1, 0, 0, -30);
|
||||
transform.translate(-150, -150);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::LayerType* container = this->createLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(container, transform, FloatPoint(100, 100), gfx::Size(200, 200), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::LayerType* container = this->createLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(container, transform, gfx::PointF(100, 100), gfx::Size(200, 200), true);
|
||||
container->setPreserves3D(true);
|
||||
layer->setPreserves3D(true);
|
||||
this->calcDrawEtc(parent);
|
||||
@ -2034,9 +2034,9 @@ protected:
|
||||
transform.rotate3d(1, 0, 0, -167);
|
||||
transform.translate(-250, -50);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(500, 100));
|
||||
typename Types::LayerType* container = this->createLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(500, 500));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(container, transform, FloatPoint(0, 0), gfx::Size(500, 500), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(500, 100));
|
||||
typename Types::LayerType* container = this->createLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(500, 500));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(container, transform, gfx::PointF(0, 0), gfx::Size(500, 500), true);
|
||||
container->setPreserves3D(true);
|
||||
layer->setPreserves3D(true);
|
||||
this->calcDrawEtc(parent);
|
||||
@ -2065,8 +2065,8 @@ protected:
|
||||
transform.translate3d(0, 0, 110);
|
||||
transform.translate(-50, -50);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, transform, FloatPoint(0, 0), gfx::Size(100, 100), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, transform, gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
||||
parent->setPreserves3D(true);
|
||||
layer->setPreserves3D(true);
|
||||
this->calcDrawEtc(parent);
|
||||
@ -2096,9 +2096,9 @@ protected:
|
||||
transform.translate3d(0, 0, 99);
|
||||
transform.translate(-50, -50);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, transform, FloatPoint(0, 0), gfx::Size(100, 100), true);
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, transform, gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
||||
parent->setPreserves3D(true);
|
||||
layer->setPreserves3D(true);
|
||||
this->calcDrawEtc(parent);
|
||||
@ -2125,13 +2125,13 @@ protected:
|
||||
OcclusionTrackerTestAnimationOpacity1OnMainThread(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild = this->createDrawingLayer(surface, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild2 = this->createDrawingLayer(surface, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 300), true);
|
||||
typename Types::ContentLayerType* parent2 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::ContentLayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(250, 0), gfx::Size(50, 300), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild = this->createDrawingLayer(surface, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild2 = this->createDrawingLayer(surface, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 300), true);
|
||||
typename Types::ContentLayerType* parent2 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::ContentLayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(250, 0), gfx::Size(50, 300), true);
|
||||
|
||||
addOpacityTransitionToController(*layer->layerAnimationController(), 10, 0, 1, false);
|
||||
addOpacityTransitionToController(*surface->layerAnimationController(), 10, 0, 1, false);
|
||||
@ -2178,13 +2178,13 @@ protected:
|
||||
OcclusionTrackerTestAnimationOpacity0OnMainThread(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild = this->createDrawingLayer(surface, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild2 = this->createDrawingLayer(surface, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 300), true);
|
||||
typename Types::ContentLayerType* parent2 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::ContentLayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(250, 0), gfx::Size(50, 300), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild = this->createDrawingLayer(surface, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild2 = this->createDrawingLayer(surface, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 300), true);
|
||||
typename Types::ContentLayerType* parent2 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::ContentLayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(250, 0), gfx::Size(50, 300), true);
|
||||
|
||||
addOpacityTransitionToController(*layer->layerAnimationController(), 10, 1, 0, false);
|
||||
addOpacityTransitionToController(*surface->layerAnimationController(), 10, 1, 0, false);
|
||||
@ -2231,12 +2231,12 @@ protected:
|
||||
OcclusionTrackerTestAnimationTranslateOnMainThread(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild = this->createDrawingLayer(surface, this->identityMatrix, FloatPoint(0, 0), gfx::Size(200, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild2 = this->createDrawingLayer(surface, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 300), true);
|
||||
typename Types::ContentLayerType* surface2 = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(50, 300), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild = this->createDrawingLayer(surface, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(200, 300), true);
|
||||
typename Types::ContentLayerType* surfaceChild2 = this->createDrawingLayer(surface, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 300), true);
|
||||
typename Types::ContentLayerType* surface2 = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(50, 300), true);
|
||||
|
||||
addAnimatedTransformToController(*layer->layerAnimationController(), 10, 30, 0);
|
||||
addAnimatedTransformToController(*surface->layerAnimationController(), 10, 30, 0);
|
||||
@ -2329,9 +2329,9 @@ protected:
|
||||
surfaceTransform.scale(2);
|
||||
surfaceTransform.translate(-150, -150);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(500, 500));
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, surfaceTransform, FloatPoint(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::ContentLayerType* surface2 = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(50, 50), gfx::Size(300, 300), false);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(500, 500));
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, surfaceTransform, gfx::PointF(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::ContentLayerType* surface2 = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(50, 50), gfx::Size(300, 300), false);
|
||||
surface->setOpaqueContentsRect(gfx::Rect(0, 0, 200, 200));
|
||||
surface2->setOpaqueContentsRect(gfx::Rect(0, 0, 200, 200));
|
||||
this->calcDrawEtc(parent);
|
||||
@ -2368,9 +2368,9 @@ protected:
|
||||
OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 300));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 300));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(500, 300), false);
|
||||
typename Types::ContentLayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(500, 300), false);
|
||||
surface->setOpaqueContentsRect(gfx::Rect(0, 0, 400, 200));
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
@ -2394,10 +2394,10 @@ protected:
|
||||
OcclusionTrackerTestReplicaOccluded(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, FloatPoint(0, 100), gfx::Size(100, 100));
|
||||
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 100), gfx::Size(100, 100), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(100, 100));
|
||||
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(100, 100), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -2433,10 +2433,10 @@ protected:
|
||||
OcclusionTrackerTestSurfaceWithReplicaUnoccluded(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, FloatPoint(0, 100), gfx::Size(100, 100));
|
||||
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 110), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(100, 100));
|
||||
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 110), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -2473,11 +2473,11 @@ protected:
|
||||
OcclusionTrackerTestSurfaceAndReplicaOccludedDifferently(bool opaqueLayers) : OcclusionTrackerTest<Types>(opaqueLayers) {}
|
||||
void runMyTest()
|
||||
{
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, FloatPoint(0, 100), gfx::Size(100, 100));
|
||||
typename Types::LayerType* overSurface = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(40, 100), true);
|
||||
typename Types::LayerType* overReplica = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 100), gfx::Size(50, 100), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
||||
this->createReplicaLayer(surface, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(100, 100));
|
||||
typename Types::LayerType* overSurface = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(40, 100), true);
|
||||
typename Types::LayerType* overReplica = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(50, 100), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -2517,10 +2517,10 @@ protected:
|
||||
{
|
||||
// This test verifies that the surface cliprect does not end up empty and clip away the entire unoccluded rect.
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100), true);
|
||||
typename Types::LayerType* surfaceChild = this->createDrawingSurface(surface, this->identityMatrix, FloatPoint(0, 10), gfx::Size(100, 50), true);
|
||||
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 50), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
||||
typename Types::LayerType* surfaceChild = this->createDrawingSurface(surface, this->identityMatrix, gfx::PointF(0, 10), gfx::Size(100, 50), true);
|
||||
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 50), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(-100, -100, 1000, 1000));
|
||||
@ -2576,8 +2576,8 @@ protected:
|
||||
{
|
||||
// This test verifies that the top-most surface is considered occluded outside of its target's clipRect and outside the viewport rect.
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 300), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 200));
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 300), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
{
|
||||
@ -2616,11 +2616,11 @@ protected:
|
||||
{
|
||||
// This test verifies that the surface cliprect does not end up empty and clip away the entire unoccluded rect.
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(80, 200));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(80, 200));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100), true);
|
||||
typename Types::LayerType* surfaceChild = this->createDrawingSurface(surface, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 100), false);
|
||||
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(100, 50), true);
|
||||
typename Types::LayerType* surface = this->createDrawingSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100), true);
|
||||
typename Types::LayerType* surfaceChild = this->createDrawingSurface(surface, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 100), false);
|
||||
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(100, 50), true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
@ -2672,14 +2672,14 @@ protected:
|
||||
// Make a surface and its replica, each 50x50, that are completely surrounded by opaque layers which are above them in the z-order.
|
||||
// The surface is scaled to test that the pixel moving is done in the target space, where the background filter is applied, but the surface
|
||||
// appears at 50, 50 and the replica at 200, 50.
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 150));
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(parent, scaleByHalf, FloatPoint(50, 50), gfx::Size(100, 100), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, FloatPoint(300, 0), gfx::Size());
|
||||
typename Types::LayerType* occludingLayer1 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 50), true);
|
||||
typename Types::LayerType* occludingLayer2 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 100), gfx::Size(300, 50), true);
|
||||
typename Types::LayerType* occludingLayer3 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 50), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* occludingLayer4 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(100, 50), gfx::Size(100, 50), true);
|
||||
typename Types::LayerType* occludingLayer5 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(250, 50), gfx::Size(50, 50), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 150));
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(parent, scaleByHalf, gfx::PointF(50, 50), gfx::Size(100, 100), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, gfx::PointF(300, 0), gfx::Size());
|
||||
typename Types::LayerType* occludingLayer1 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 50), true);
|
||||
typename Types::LayerType* occludingLayer2 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(300, 50), true);
|
||||
typename Types::LayerType* occludingLayer3 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 50), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* occludingLayer4 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(100, 50), gfx::Size(100, 50), true);
|
||||
typename Types::LayerType* occludingLayer5 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(250, 50), gfx::Size(50, 50), true);
|
||||
|
||||
// Filters make the layer own a surface.
|
||||
WebFilterOperations filters;
|
||||
@ -2792,12 +2792,12 @@ protected:
|
||||
scaleByHalf.scale(0.5);
|
||||
|
||||
// Makes two surfaces that completely cover |parent|. The occlusion both above and below the filters will be reduced by each of them.
|
||||
typename Types::ContentLayerType* root = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(75, 75));
|
||||
typename Types::LayerType* parent = this->createSurface(root, scaleByHalf, FloatPoint(0, 0), gfx::Size(150, 150));
|
||||
typename Types::ContentLayerType* root = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(75, 75));
|
||||
typename Types::LayerType* parent = this->createSurface(root, scaleByHalf, gfx::PointF(0, 0), gfx::Size(150, 150));
|
||||
parent->setMasksToBounds(true);
|
||||
typename Types::LayerType* filteredSurface1 = this->createDrawingLayer(parent, scaleByHalf, FloatPoint(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::LayerType* filteredSurface2 = this->createDrawingLayer(parent, scaleByHalf, FloatPoint(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::LayerType* occludingLayerAbove = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(100, 100), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* filteredSurface1 = this->createDrawingLayer(parent, scaleByHalf, gfx::PointF(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::LayerType* filteredSurface2 = this->createDrawingLayer(parent, scaleByHalf, gfx::PointF(0, 0), gfx::Size(300, 300), false);
|
||||
typename Types::LayerType* occludingLayerAbove = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(100, 100), gfx::Size(50, 50), true);
|
||||
|
||||
// Filters make the layers own surfaces.
|
||||
WebFilterOperations filters;
|
||||
@ -2846,18 +2846,18 @@ protected:
|
||||
void runMyTest()
|
||||
{
|
||||
// Make a surface and its replica, each 50x50, that are completely surrounded by opaque layers which are above them in the z-order.
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 150));
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 150));
|
||||
// We stick the filtered surface inside a clipping surface so that we can make sure the clip is honored when exposing pixels for
|
||||
// the background filter.
|
||||
typename Types::LayerType* clippingSurface = this->createSurface(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 70));
|
||||
typename Types::LayerType* clippingSurface = this->createSurface(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 70));
|
||||
clippingSurface->setMasksToBounds(true);
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(clippingSurface, this->identityMatrix, FloatPoint(50, 50), gfx::Size(50, 50), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, FloatPoint(150, 0), gfx::Size());
|
||||
typename Types::LayerType* occludingLayer1 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 50), true);
|
||||
typename Types::LayerType* occludingLayer2 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 100), gfx::Size(300, 50), true);
|
||||
typename Types::LayerType* occludingLayer3 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 50), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* occludingLayer4 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(100, 50), gfx::Size(100, 50), true);
|
||||
typename Types::LayerType* occludingLayer5 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(250, 50), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(clippingSurface, this->identityMatrix, gfx::PointF(50, 50), gfx::Size(50, 50), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, gfx::PointF(150, 0), gfx::Size());
|
||||
typename Types::LayerType* occludingLayer1 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 50), true);
|
||||
typename Types::LayerType* occludingLayer2 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 100), gfx::Size(300, 50), true);
|
||||
typename Types::LayerType* occludingLayer3 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 50), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* occludingLayer4 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(100, 50), gfx::Size(100, 50), true);
|
||||
typename Types::LayerType* occludingLayer5 = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(250, 50), gfx::Size(50, 50), true);
|
||||
|
||||
// Filters make the layer own a surface. This filter is large enough that it goes outside the bottom of the clippingSurface.
|
||||
WebFilterOperations filters;
|
||||
@ -2973,11 +2973,11 @@ protected:
|
||||
// Make a surface and its replica, each 50x50, with a smaller 30x30 layer centered below each.
|
||||
// The surface is scaled to test that the pixel moving is done in the target space, where the background filter is applied, but the surface
|
||||
// appears at 50, 50 and the replica at 200, 50.
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 150));
|
||||
typename Types::LayerType* behindSurfaceLayer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(60, 60), gfx::Size(30, 30), true);
|
||||
typename Types::LayerType* behindReplicaLayer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(210, 60), gfx::Size(30, 30), true);
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(parent, scaleByHalf, FloatPoint(50, 50), gfx::Size(100, 100), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, FloatPoint(300, 0), gfx::Size());
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 150));
|
||||
typename Types::LayerType* behindSurfaceLayer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(60, 60), gfx::Size(30, 30), true);
|
||||
typename Types::LayerType* behindReplicaLayer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(210, 60), gfx::Size(30, 30), true);
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(parent, scaleByHalf, gfx::PointF(50, 50), gfx::Size(100, 100), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, gfx::PointF(300, 0), gfx::Size());
|
||||
|
||||
// Filters make the layer own a surface.
|
||||
WebFilterOperations filters;
|
||||
@ -3023,11 +3023,11 @@ protected:
|
||||
// Make a surface and its replica, each 50x50, that are completely occluded by opaque layers which are above them in the z-order.
|
||||
// The surface is scaled to test that the pixel moving is done in the target space, where the background filter is applied, but the surface
|
||||
// appears at 50, 50 and the replica at 200, 50.
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 150));
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(parent, scaleByHalf, FloatPoint(50, 50), gfx::Size(100, 100), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, FloatPoint(300, 0), gfx::Size());
|
||||
typename Types::LayerType* aboveSurfaceLayer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(50, 50), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* aboveReplicaLayer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(200, 50), gfx::Size(50, 50), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 150));
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(parent, scaleByHalf, gfx::PointF(50, 50), gfx::Size(100, 100), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, gfx::PointF(300, 0), gfx::Size());
|
||||
typename Types::LayerType* aboveSurfaceLayer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(50, 50), gfx::Size(50, 50), true);
|
||||
typename Types::LayerType* aboveReplicaLayer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(200, 50), gfx::Size(50, 50), true);
|
||||
|
||||
// Filters make the layer own a surface.
|
||||
WebFilterOperations filters;
|
||||
@ -3072,13 +3072,13 @@ protected:
|
||||
// Make a surface and its replica, each 50x50, that are partially occluded by opaque layers which are above them in the z-order.
|
||||
// The surface is scaled to test that the pixel moving is done in the target space, where the background filter is applied, but the surface
|
||||
// appears at 50, 50 and the replica at 200, 50.
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(300, 150));
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(parent, scaleByHalf, FloatPoint(50, 50), gfx::Size(100, 100), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, FloatPoint(300, 0), gfx::Size());
|
||||
typename Types::LayerType* aboveSurfaceLayer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(70, 50), gfx::Size(30, 50), true);
|
||||
typename Types::LayerType* aboveReplicaLayer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(200, 50), gfx::Size(30, 50), true);
|
||||
typename Types::LayerType* besideSurfaceLayer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(90, 40), gfx::Size(10, 10), true);
|
||||
typename Types::LayerType* besideReplicaLayer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(200, 40), gfx::Size(10, 10), true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(300, 150));
|
||||
typename Types::LayerType* filteredSurface = this->createDrawingLayer(parent, scaleByHalf, gfx::PointF(50, 50), gfx::Size(100, 100), false);
|
||||
this->createReplicaLayer(filteredSurface, this->identityMatrix, gfx::PointF(300, 0), gfx::Size());
|
||||
typename Types::LayerType* aboveSurfaceLayer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(70, 50), gfx::Size(30, 50), true);
|
||||
typename Types::LayerType* aboveReplicaLayer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(200, 50), gfx::Size(30, 50), true);
|
||||
typename Types::LayerType* besideSurfaceLayer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(90, 40), gfx::Size(10, 10), true);
|
||||
typename Types::LayerType* besideReplicaLayer = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(200, 40), gfx::Size(10, 10), true);
|
||||
|
||||
// Filters make the layer own a surface.
|
||||
WebFilterOperations filters;
|
||||
@ -3113,10 +3113,10 @@ protected:
|
||||
gfx::Rect occlusionBesideReplica = gfx::Rect(200, 40, 10, 10);
|
||||
|
||||
Region expectedOcclusion;
|
||||
expectedOcclusion.unite(cc::IntRect(occlusionAboveSurface));
|
||||
expectedOcclusion.unite(cc::IntRect(occlusionAboveReplica));
|
||||
expectedOcclusion.unite(cc::IntRect(occlusionBesideSurface));
|
||||
expectedOcclusion.unite(cc::IntRect(occlusionBesideReplica));
|
||||
expectedOcclusion.Union(occlusionAboveSurface);
|
||||
expectedOcclusion.Union(occlusionAboveReplica);
|
||||
expectedOcclusion.Union(occlusionBesideSurface);
|
||||
expectedOcclusion.Union(occlusionBesideReplica);
|
||||
|
||||
ASSERT_EQ(expectedOcclusion.rects().size(), occlusion.occlusionInTargetSurface().rects().size());
|
||||
ASSERT_EQ(expectedOcclusion.rects().size(), occlusion.occlusionInScreenSpace().rects().size());
|
||||
@ -3142,9 +3142,9 @@ protected:
|
||||
gfx::Size trackingSize(100, 100);
|
||||
gfx::Size belowTrackingSize(99, 99);
|
||||
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), gfx::Size(400, 400));
|
||||
typename Types::LayerType* large = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), trackingSize, true);
|
||||
typename Types::LayerType* small = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), belowTrackingSize, true);
|
||||
typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, gfx::PointF(0, 0), gfx::Size(400, 400));
|
||||
typename Types::LayerType* large = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), trackingSize, true);
|
||||
typename Types::LayerType* small = this->createDrawingLayer(parent, this->identityMatrix, gfx::PointF(0, 0), belowTrackingSize, true);
|
||||
this->calcDrawEtc(parent);
|
||||
|
||||
TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
|
||||
|
@ -7,12 +7,12 @@
|
||||
#include "cc/overdraw_metrics.h"
|
||||
|
||||
#include "FloatQuad.h"
|
||||
#include "IntRect.h"
|
||||
#include "base/debug/trace_event.h"
|
||||
#include "base/metrics/histogram.h"
|
||||
#include "cc/layer_tree_host.h"
|
||||
#include "cc/layer_tree_host_impl.h"
|
||||
#include "cc/math_util.h"
|
||||
#include "ui/gfx/rect.h"
|
||||
#include <public/WebTransformationMatrix.h>
|
||||
|
||||
using WebKit::WebTransformationMatrix;
|
||||
@ -59,7 +59,7 @@ static inline float areaOfMappedQuad(const WebTransformationMatrix& transform, c
|
||||
return polygonArea(clippedQuad, numVerticesInClippedQuad);
|
||||
}
|
||||
|
||||
void OverdrawMetrics::didPaint(const IntRect& paintedRect)
|
||||
void OverdrawMetrics::didPaint(const gfx::Rect& paintedRect)
|
||||
{
|
||||
if (!m_recordMetricsForFrame)
|
||||
return;
|
||||
@ -73,13 +73,13 @@ void OverdrawMetrics::didCullTilesForUpload(int count)
|
||||
m_tilesCulledForUpload += count;
|
||||
}
|
||||
|
||||
void OverdrawMetrics::didUpload(const WebTransformationMatrix& transformToTarget, const IntRect& uploadRect, const IntRect& opaqueRect)
|
||||
void OverdrawMetrics::didUpload(const WebTransformationMatrix& transformToTarget, const gfx::Rect& uploadRect, const gfx::Rect& opaqueRect)
|
||||
{
|
||||
if (!m_recordMetricsForFrame)
|
||||
return;
|
||||
|
||||
float uploadArea = areaOfMappedQuad(transformToTarget, FloatQuad(uploadRect));
|
||||
float uploadOpaqueArea = areaOfMappedQuad(transformToTarget, FloatQuad(intersection(opaqueRect, uploadRect)));
|
||||
float uploadOpaqueArea = areaOfMappedQuad(transformToTarget, FloatQuad(gfx::IntersectRects(opaqueRect, uploadRect)));
|
||||
|
||||
m_pixelsUploadedOpaque += uploadOpaqueArea;
|
||||
m_pixelsUploadedTranslucent += uploadArea - uploadOpaqueArea;
|
||||
@ -101,7 +101,7 @@ void OverdrawMetrics::didUseRenderSurfaceTextureMemoryBytes(size_t renderSurface
|
||||
m_renderSurfaceTextureUseBytes += renderSurfaceUseBytes;
|
||||
}
|
||||
|
||||
void OverdrawMetrics::didCullForDrawing(const WebTransformationMatrix& transformToTarget, const IntRect& beforeCullRect, const IntRect& afterCullRect)
|
||||
void OverdrawMetrics::didCullForDrawing(const WebTransformationMatrix& transformToTarget, const gfx::Rect& beforeCullRect, const gfx::Rect& afterCullRect)
|
||||
{
|
||||
if (!m_recordMetricsForFrame)
|
||||
return;
|
||||
@ -112,13 +112,13 @@ void OverdrawMetrics::didCullForDrawing(const WebTransformationMatrix& transform
|
||||
m_pixelsCulledForDrawing += beforeCullArea - afterCullArea;
|
||||
}
|
||||
|
||||
void OverdrawMetrics::didDraw(const WebTransformationMatrix& transformToTarget, const IntRect& afterCullRect, const IntRect& opaqueRect)
|
||||
void OverdrawMetrics::didDraw(const WebTransformationMatrix& transformToTarget, const gfx::Rect& afterCullRect, const gfx::Rect& opaqueRect)
|
||||
{
|
||||
if (!m_recordMetricsForFrame)
|
||||
return;
|
||||
|
||||
float afterCullArea = areaOfMappedQuad(transformToTarget, FloatQuad(afterCullRect));
|
||||
float afterCullOpaqueArea = areaOfMappedQuad(transformToTarget, FloatQuad(intersection(opaqueRect, afterCullRect)));
|
||||
float afterCullOpaqueArea = areaOfMappedQuad(transformToTarget, FloatQuad(gfx::IntersectRects(opaqueRect, afterCullRect)));
|
||||
|
||||
m_pixelsDrawnOpaque += afterCullOpaqueArea;
|
||||
m_pixelsDrawnTranslucent += afterCullArea - afterCullOpaqueArea;
|
||||
|
@ -7,12 +7,15 @@
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
|
||||
namespace gfx {
|
||||
class Rect;
|
||||
}
|
||||
|
||||
namespace WebKit {
|
||||
class WebTransformationMatrix;
|
||||
}
|
||||
|
||||
namespace cc {
|
||||
class IntRect;
|
||||
class LayerTreeHost;
|
||||
class LayerTreeHostImpl;
|
||||
|
||||
@ -24,11 +27,11 @@ public:
|
||||
// These methods are used for saving metrics during update/commit.
|
||||
|
||||
// Record pixels painted by WebKit into the texture updater, but does not mean the pixels were rasterized in main memory.
|
||||
void didPaint(const IntRect& paintedRect);
|
||||
void didPaint(const gfx::Rect& paintedRect);
|
||||
// Records that an invalid tile was culled and did not need to be painted/uploaded, and did not contribute to other tiles needing to be painted.
|
||||
void didCullTilesForUpload(int count);
|
||||
// Records pixels that were uploaded to texture memory.
|
||||
void didUpload(const WebKit::WebTransformationMatrix& transformToTarget, const IntRect& uploadRect, const IntRect& opaqueRect);
|
||||
void didUpload(const WebKit::WebTransformationMatrix& transformToTarget, const gfx::Rect& uploadRect, const gfx::Rect& opaqueRect);
|
||||
// Record contents texture(s) behind present using the given number of bytes.
|
||||
void didUseContentsTextureMemoryBytes(size_t contentsTextureUseBytes);
|
||||
// Record RenderSurfaceImpl texture(s) being present using the given number of bytes.
|
||||
@ -37,9 +40,9 @@ public:
|
||||
// These methods are used for saving metrics during draw.
|
||||
|
||||
// Record pixels that were not drawn to screen.
|
||||
void didCullForDrawing(const WebKit::WebTransformationMatrix& transformToTarget, const IntRect& beforeCullRect, const IntRect& afterCullRect);
|
||||
void didCullForDrawing(const WebKit::WebTransformationMatrix& transformToTarget, const gfx::Rect& beforeCullRect, const gfx::Rect& afterCullRect);
|
||||
// Record pixels that were drawn to screen.
|
||||
void didDraw(const WebKit::WebTransformationMatrix& transformToTarget, const IntRect& afterCullRect, const IntRect& opaqueRect);
|
||||
void didDraw(const WebKit::WebTransformationMatrix& transformToTarget, const gfx::Rect& afterCullRect, const gfx::Rect& opaqueRect);
|
||||
|
||||
void recordMetrics(const LayerTreeHost*) const;
|
||||
void recordMetrics(const LayerTreeHostImpl*) const;
|
||||
|
@ -6,19 +6,22 @@
|
||||
|
||||
#include "cc/page_scale_animation.h"
|
||||
|
||||
#include "FloatRect.h"
|
||||
#include "FloatPoint.h"
|
||||
#include "FloatSize.h"
|
||||
#include "IntPoint.h"
|
||||
#include "IntSize.h"
|
||||
#include "ui/gfx/rect_f.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
namespace cc {
|
||||
|
||||
scoped_ptr<PageScaleAnimation> PageScaleAnimation::create(const IntSize& scrollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& contentSize, double startTime)
|
||||
scoped_ptr<PageScaleAnimation> PageScaleAnimation::create(const IntSize& scrollStart, float pageScaleStart, const gfx::Size& windowSize, const gfx::Size& contentSize, double startTime)
|
||||
{
|
||||
return make_scoped_ptr(new PageScaleAnimation(scrollStart, pageScaleStart, windowSize, contentSize, startTime));
|
||||
}
|
||||
|
||||
PageScaleAnimation::PageScaleAnimation(const IntSize& scrollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& contentSize, double startTime)
|
||||
PageScaleAnimation::PageScaleAnimation(const IntSize& scrollStart, float pageScaleStart, const gfx::Size& windowSize, const gfx::Size& contentSize, double startTime)
|
||||
: m_scrollStart(scrollStart)
|
||||
, m_pageScaleStart(pageScaleStart)
|
||||
, m_windowSize(windowSize)
|
||||
@ -31,14 +34,18 @@ PageScaleAnimation::PageScaleAnimation(const IntSize& scrollStart, float pageSca
|
||||
{
|
||||
}
|
||||
|
||||
PageScaleAnimation::~PageScaleAnimation()
|
||||
{
|
||||
}
|
||||
|
||||
void PageScaleAnimation::zoomTo(const IntSize& finalScroll, float finalPageScale, double duration)
|
||||
{
|
||||
if (m_pageScaleStart != finalPageScale) {
|
||||
// For uniform-looking zooming, infer the anchor (point that remains in
|
||||
// place throughout the zoom) from the start and end rects.
|
||||
FloatRect startRect(IntPoint(m_scrollStart), m_windowSize);
|
||||
FloatRect endRect(IntPoint(finalScroll), m_windowSize);
|
||||
endRect.scale(m_pageScaleStart / finalPageScale);
|
||||
gfx::RectF startRect(cc::FloatPoint(cc::IntPoint(m_scrollStart)), m_windowSize);
|
||||
gfx::RectF endRect(cc::FloatPoint(cc::IntPoint(finalScroll)), m_windowSize);
|
||||
endRect.Scale(m_pageScaleStart / finalPageScale);
|
||||
|
||||
// The anchor is the point which is at the same ratio of the sides of
|
||||
// both startRect and endRect. For example, a zoom-in double-tap to a
|
||||
@ -73,9 +80,8 @@ void PageScaleAnimation::zoomWithAnchor(const IntSize& anchor, float finalPageSc
|
||||
m_scrollEnd -= anchor;
|
||||
|
||||
m_scrollEnd.clampNegativeToZero();
|
||||
FloatSize scaledContentSize(m_contentSize);
|
||||
scaledContentSize.scale(finalPageScale / m_pageScaleStart);
|
||||
IntSize maxScrollPosition = roundedIntSize(scaledContentSize - m_windowSize);
|
||||
gfx::SizeF scaledContentSize = m_contentSize.Scale(finalPageScale / m_pageScaleStart);
|
||||
IntSize maxScrollPosition = roundedIntSize(cc::FloatSize(scaledContentSize) - cc::IntSize(m_windowSize));
|
||||
m_scrollEnd = m_scrollEnd.shrunkTo(maxScrollPosition);
|
||||
|
||||
m_anchor = anchor;
|
||||
|
@ -19,7 +19,8 @@ public:
|
||||
// Construct with the starting page scale and scroll offset (which is in
|
||||
// pageScaleStart space). The window size is the user-viewable area
|
||||
// in pixels.
|
||||
static scoped_ptr<PageScaleAnimation> create(const IntSize& scrollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& contentSize, double startTime);
|
||||
static scoped_ptr<PageScaleAnimation> create(const IntSize& scrollStart, float pageScaleStart, const gfx::Size& windowSize, const gfx::Size& contentSize, double startTime);
|
||||
~PageScaleAnimation();
|
||||
|
||||
// The following methods initialize the animation. Call one of them
|
||||
// immediately after construction to set the final scroll and page scale.
|
||||
@ -48,7 +49,7 @@ public:
|
||||
float finalPageScale() const { return m_pageScaleEnd; }
|
||||
|
||||
protected:
|
||||
PageScaleAnimation(const IntSize& scrollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& contentSize, double startTime);
|
||||
PageScaleAnimation(const IntSize& scrollStart, float pageScaleStart, const gfx::Size& windowSize, const gfx::Size& contentSize, double startTime);
|
||||
|
||||
private:
|
||||
float progressRatioForTime(double time) const;
|
||||
@ -57,8 +58,8 @@ private:
|
||||
|
||||
IntSize m_scrollStart;
|
||||
float m_pageScaleStart;
|
||||
IntSize m_windowSize;
|
||||
IntSize m_contentSize;
|
||||
gfx::Size m_windowSize;
|
||||
gfx::Size m_contentSize;
|
||||
|
||||
bool m_anchorMode;
|
||||
IntSize m_anchor;
|
||||
|
@ -53,8 +53,8 @@ static inline bool appendQuadInternal(scoped_ptr<DrawQuad> drawQuad, const gfx::
|
||||
if (keepQuad)
|
||||
drawQuad->setQuadVisibleRect(culledRect);
|
||||
|
||||
occlusionTracker.overdrawMetrics().didCullForDrawing(drawQuad->quadTransform(), cc::IntRect(drawQuad->quadRect()), cc::IntRect(culledRect));
|
||||
occlusionTracker.overdrawMetrics().didDraw(drawQuad->quadTransform(), cc::IntRect(culledRect), cc::IntRect(drawQuad->opaqueRect()));
|
||||
occlusionTracker.overdrawMetrics().didCullForDrawing(drawQuad->quadTransform(), drawQuad->quadRect(), culledRect);
|
||||
occlusionTracker.overdrawMetrics().didDraw(drawQuad->quadTransform(), culledRect, drawQuad->opaqueRect());
|
||||
|
||||
if (keepQuad) {
|
||||
if (createDebugBorderQuads && !drawQuad->isDebugQuad() && drawQuad->quadVisibleRect() != drawQuad->quadRect()) {
|
||||
@ -80,9 +80,9 @@ bool QuadCuller::append(scoped_ptr<DrawQuad> drawQuad, AppendQuadsData& appendQu
|
||||
bool implDrawTransformIsUnknown = false;
|
||||
|
||||
if (m_forSurface)
|
||||
culledRect = m_occlusionTracker->unoccludedContributingSurfaceContentRect(m_layer, false, cc::IntRect(drawQuad->quadRect()), &hasOcclusionFromOutsideTargetSurface);
|
||||
culledRect = m_occlusionTracker->unoccludedContributingSurfaceContentRect(m_layer, false, drawQuad->quadRect(), &hasOcclusionFromOutsideTargetSurface);
|
||||
else
|
||||
culledRect = m_occlusionTracker->unoccludedContentRect(m_layer->renderTarget(), cc::IntRect(drawQuad->quadRect()), drawQuad->quadTransform(), implDrawTransformIsUnknown, cc::IntRect(drawQuad->clippedRectInTarget()), &hasOcclusionFromOutsideTargetSurface);
|
||||
culledRect = m_occlusionTracker->unoccludedContentRect(m_layer->renderTarget(), drawQuad->quadRect(), drawQuad->quadTransform(), implDrawTransformIsUnknown, drawQuad->clippedRectInTarget(), &hasOcclusionFromOutsideTargetSurface);
|
||||
|
||||
appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclusionFromOutsideTargetSurface;
|
||||
|
||||
|
@ -83,7 +83,7 @@ void RenderPass::appendQuadsToFillScreen(LayerImpl* rootLayer, SkColor screenBac
|
||||
return;
|
||||
|
||||
Region fillRegion = occlusionTracker.computeVisibleRegionInScreen();
|
||||
if (fillRegion.isEmpty())
|
||||
if (fillRegion.IsEmpty())
|
||||
return;
|
||||
|
||||
bool forSurface = false;
|
||||
|
@ -5,7 +5,6 @@
|
||||
#ifndef CCRenderPass_h
|
||||
#define CCRenderPass_h
|
||||
|
||||
#include "FloatRect.h"
|
||||
#include "base/basictypes.h"
|
||||
#include "cc/draw_quad.h"
|
||||
#include "cc/hash_pair.h"
|
||||
|
@ -46,7 +46,7 @@ TEST(RenderSurfaceTest, verifySurfaceChangesAreTrackedProperly)
|
||||
owningLayer->createRenderSurface();
|
||||
ASSERT_TRUE(owningLayer->renderSurface());
|
||||
RenderSurfaceImpl* renderSurface = owningLayer->renderSurface();
|
||||
IntRect testRect = IntRect(IntPoint(3, 4), IntSize(5, 6));
|
||||
gfx::Rect testRect = gfx::Rect(gfx::Point(3, 4), gfx::Size(5, 6));
|
||||
owningLayer->resetAllChangeTrackingForSubtree();
|
||||
|
||||
// Currently, the contentRect, clipRect, and owningLayer->layerPropertyChanged() are
|
||||
@ -89,8 +89,8 @@ TEST(RenderSurfaceTest, sanityCheckSurfaceCreatesCorrectSharedQuadState)
|
||||
|
||||
rootLayer->addChild(owningLayer.Pass());
|
||||
|
||||
IntRect contentRect = IntRect(IntPoint::zero(), IntSize(50, 50));
|
||||
IntRect clipRect = IntRect(IntPoint(5, 5), IntSize(40, 40));
|
||||
gfx::Rect contentRect = gfx::Rect(gfx::Point(), gfx::Size(50, 50));
|
||||
gfx::Rect clipRect = gfx::Rect(gfx::Point(5, 5), gfx::Size(40, 40));
|
||||
WebTransformationMatrix origin;
|
||||
|
||||
origin.translate(30, 40);
|
||||
@ -113,7 +113,7 @@ TEST(RenderSurfaceTest, sanityCheckSurfaceCreatesCorrectSharedQuadState)
|
||||
|
||||
EXPECT_EQ(30, sharedQuadState->quadTransform.m41());
|
||||
EXPECT_EQ(40, sharedQuadState->quadTransform.m42());
|
||||
EXPECT_RECT_EQ(contentRect, IntRect(sharedQuadState->visibleContentRect));
|
||||
EXPECT_RECT_EQ(contentRect, gfx::Rect(sharedQuadState->visibleContentRect));
|
||||
EXPECT_EQ(1, sharedQuadState->opacity);
|
||||
EXPECT_FALSE(sharedQuadState->opaque);
|
||||
}
|
||||
@ -143,7 +143,7 @@ TEST(RenderSurfaceTest, sanityCheckSurfaceCreatesCorrectRenderPass)
|
||||
|
||||
rootLayer->addChild(owningLayer.Pass());
|
||||
|
||||
IntRect contentRect = IntRect(IntPoint::zero(), IntSize(50, 50));
|
||||
gfx::Rect contentRect = gfx::Rect(gfx::Point(), gfx::Size(50, 50));
|
||||
WebTransformationMatrix origin;
|
||||
origin.translate(30, 40);
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "cc/quad_sink.h"
|
||||
#include "cc/scrollbar_animation_controller.h"
|
||||
#include "cc/texture_draw_quad.h"
|
||||
#include "ui/gfx/rect_conversions.h"
|
||||
|
||||
using WebKit::WebRect;
|
||||
using WebKit::WebScrollbar;
|
||||
@ -71,13 +72,12 @@ static gfx::RectF toUVRect(const gfx::Rect& r, const gfx::Rect& bounds)
|
||||
return gfx::ScaleRect(r, 1.0 / bounds.width(), 1.0 / bounds.height());
|
||||
}
|
||||
|
||||
IntRect ScrollbarLayerImpl::scrollbarLayerRectToContentRect(const WebRect& layerRect) const
|
||||
gfx::Rect ScrollbarLayerImpl::scrollbarLayerRectToContentRect(const gfx::Rect& layerRect) const
|
||||
{
|
||||
// Don't intersect with the bounds as in layerRectToContentRect() because
|
||||
// layerRect here might be in coordinates of the containing layer.
|
||||
FloatRect contentRect(layerRect.x, layerRect.y, layerRect.width, layerRect.height);
|
||||
contentRect.scale(contentsScaleX(), contentsScaleY());
|
||||
return enclosingIntRect(contentRect);
|
||||
gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), contentsScaleY());
|
||||
return gfx::ToEnclosingRect(contentRect);
|
||||
}
|
||||
|
||||
void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuadsData)
|
||||
|
@ -77,7 +77,7 @@ private:
|
||||
|
||||
virtual const char* layerTypeAsString() const OVERRIDE;
|
||||
|
||||
IntRect scrollbarLayerRectToContentRect(const WebKit::WebRect& layerRect) const;
|
||||
gfx::Rect scrollbarLayerRectToContentRect(const gfx::Rect& layerRect) const;
|
||||
|
||||
Scrollbar m_scrollbar;
|
||||
|
||||
|
@ -34,7 +34,7 @@ void SolidColorLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appen
|
||||
int height = contentBounds().height();
|
||||
for (int x = 0; x < width; x += m_tileSize) {
|
||||
for (int y = 0; y < height; y += m_tileSize) {
|
||||
IntRect solidTileRect(x, y, std::min(width - x, m_tileSize), std::min(height - y, m_tileSize));
|
||||
gfx::Rect solidTileRect(x, y, std::min(width - x, m_tileSize), std::min(height - y, m_tileSize));
|
||||
quadSink.append(SolidColorDrawQuad::create(sharedQuadState, solidTileRect, backgroundColor()).PassAs<DrawQuad>(), appendQuadsData);
|
||||
}
|
||||
}
|
||||
|
@ -24,8 +24,8 @@ TEST(SolidColorLayerImplTest, verifyTilingCompleteAndNoOverlap)
|
||||
DebugScopedSetImplThread scopedImplThread;
|
||||
|
||||
MockQuadCuller quadCuller;
|
||||
IntSize layerSize = IntSize(800, 600);
|
||||
IntRect visibleContentRect = IntRect(IntPoint(), layerSize);
|
||||
gfx::Size layerSize = gfx::Size(800, 600);
|
||||
gfx::Rect visibleContentRect = gfx::Rect(gfx::Point(), layerSize);
|
||||
|
||||
scoped_ptr<SolidColorLayerImpl> layer = SolidColorLayerImpl::create(1);
|
||||
layer->setVisibleContentRect(visibleContentRect);
|
||||
@ -47,8 +47,8 @@ TEST(SolidColorLayerImplTest, verifyCorrectBackgroundColorInQuad)
|
||||
SkColor testColor = 0xFFA55AFF;
|
||||
|
||||
MockQuadCuller quadCuller;
|
||||
IntSize layerSize = IntSize(100, 100);
|
||||
IntRect visibleContentRect = IntRect(IntPoint(), layerSize);
|
||||
gfx::Size layerSize = gfx::Size(100, 100);
|
||||
gfx::Rect visibleContentRect = gfx::Rect(gfx::Point(), layerSize);
|
||||
|
||||
scoped_ptr<SolidColorLayerImpl> layer = SolidColorLayerImpl::create(1);
|
||||
layer->setVisibleContentRect(visibleContentRect);
|
||||
@ -72,8 +72,8 @@ TEST(SolidColorLayerImplTest, verifyCorrectOpacityInQuad)
|
||||
const float opacity = 0.5f;
|
||||
|
||||
MockQuadCuller quadCuller;
|
||||
IntSize layerSize = IntSize(100, 100);
|
||||
IntRect visibleContentRect = IntRect(IntPoint(), layerSize);
|
||||
gfx::Size layerSize = gfx::Size(100, 100);
|
||||
gfx::Rect visibleContentRect = gfx::Rect(gfx::Point(), layerSize);
|
||||
|
||||
scoped_ptr<SolidColorLayerImpl> layer = SolidColorLayerImpl::create(1);
|
||||
layer->setVisibleContentRect(visibleContentRect);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#else
|
||||
#include "third_party/WebKit/Source/WebCore/platform/graphics/Region.h"
|
||||
#endif
|
||||
#include "ui/gfx/rect.h"
|
||||
|
||||
namespace cc {
|
||||
|
||||
@ -32,8 +33,40 @@ public:
|
||||
: WebCore::Region(region)
|
||||
{
|
||||
}
|
||||
|
||||
Region(const gfx::Rect& rect)
|
||||
: WebCore::Region(WebCore::IntRect(rect.x(), rect.y(), rect.width(), rect.height()))
|
||||
{
|
||||
}
|
||||
|
||||
bool IsEmpty() const { return isEmpty(); }
|
||||
|
||||
bool Contains(const gfx::Point& point) const { return contains(cc::IntPoint(point)); }
|
||||
bool Contains(const gfx::Rect& rect) const { return contains(cc::IntRect(rect)); }
|
||||
void Subtract(const gfx::Rect& rect) { subtract(cc::IntRect(rect)); }
|
||||
void Subtract(const Region& region) { subtract(region); }
|
||||
void Union(const gfx::Rect& rect) { unite(cc::IntRect(rect)); }
|
||||
void Union(const Region& region) { unite(region); }
|
||||
void Intersect(const gfx::Rect& rect) { intersect(cc::IntRect(rect)); }
|
||||
void Intersect(const Region& region) { intersect(region); }
|
||||
|
||||
gfx::Rect bounds() const { return cc::IntRect(WebCore::Region::bounds()); }
|
||||
|
||||
private:
|
||||
bool isEmpty() const { return WebCore::Region::isEmpty(); }
|
||||
bool contains(const IntPoint& point) const { return WebCore::Region::contains(point); }
|
||||
bool contains(const IntRect& rect) const { return WebCore::Region::contains(rect); }
|
||||
void subtract(const IntRect& rect) { return WebCore::Region::subtract(rect); }
|
||||
void subtract(const Region& region) { return WebCore::Region::subtract(region); }
|
||||
void unite(const IntRect& rect) { return WebCore::Region::unite(rect); }
|
||||
void unite(const Region& region) { return WebCore::Region::unite(region); }
|
||||
void intersect(const IntRect& rect) { return WebCore::Region::intersect(rect); }
|
||||
void intersect(const Region& region) { return WebCore::Region::intersect(region); }
|
||||
};
|
||||
|
||||
inline Region subtract(const Region& region, const gfx::Rect& rect) { return WebCore::intersect(region, cc::IntRect(rect)); }
|
||||
inline Region intersect(const Region& region, const gfx::Rect& rect) { return WebCore::intersect(region, cc::IntRect(rect)); }
|
||||
|
||||
}
|
||||
|
||||
#endif // CC_STUBS_REGION_H_
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "third_party/WebKit/Source/WebCore/platform/graphics/FloatSize.h"
|
||||
#endif
|
||||
#include "ui/gfx/size_f.h"
|
||||
#include "ui/gfx/vector2d_f.h"
|
||||
|
||||
namespace cc {
|
||||
class FloatSize : public WebCore::FloatSize {
|
||||
@ -43,7 +44,14 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
explicit FloatSize(gfx::Vector2dF vector)
|
||||
: WebCore::FloatSize(vector.x(), vector.y())
|
||||
{
|
||||
}
|
||||
|
||||
operator gfx::SizeF() const { return gfx::SizeF(width(), height()); }
|
||||
|
||||
operator gfx::Vector2dF() const { return gfx::Vector2dF(width(), height()); }
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "third_party/WebKit/Source/WebCore/platform/graphics/IntSize.h"
|
||||
#endif
|
||||
#include "ui/gfx/size.h"
|
||||
#include "ui/gfx/vector2d.h"
|
||||
|
||||
namespace cc {
|
||||
|
||||
@ -34,7 +35,14 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
explicit IntSize(gfx::Vector2d vector)
|
||||
: WebCore::IntSize(vector.x(), vector.y())
|
||||
{
|
||||
}
|
||||
|
||||
operator gfx::Size() const { return gfx::Size(width(), height()); }
|
||||
|
||||
operator gfx::Vector2d() const { return gfx::Vector2d(width(), height()); }
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "cc/test/layer_test_common.h"
|
||||
|
||||
#include "FloatRect.h"
|
||||
#include "Region.h"
|
||||
#include "cc/draw_quad.h"
|
||||
#include "cc/math_util.h"
|
||||
@ -37,7 +38,7 @@ bool canRectFBeSafelyRoundedToRect(const gfx::RectF& r)
|
||||
|
||||
void verifyQuadsExactlyCoverRect(const cc::QuadList& quads,
|
||||
const gfx::Rect& rect) {
|
||||
cc::Region remaining = cc::IntRect(rect);
|
||||
cc::Region remaining = rect;
|
||||
|
||||
for (size_t i = 0; i < quads.size(); ++i) {
|
||||
cc::DrawQuad* quad = quads[i];
|
||||
@ -50,11 +51,11 @@ void verifyQuadsExactlyCoverRect(const cc::QuadList& quads,
|
||||
gfx::Rect quadRect = gfx::ToEnclosingRect(quadRectF);
|
||||
|
||||
EXPECT_TRUE(rect.Contains(quadRect)) << quadString << i;
|
||||
EXPECT_TRUE(remaining.contains(cc::IntRect(quadRect))) << quadString << i;
|
||||
remaining.subtract(cc::IntRect(quadRect));
|
||||
EXPECT_TRUE(remaining.Contains(quadRect)) << quadString << i;
|
||||
remaining.Subtract(quadRect);
|
||||
}
|
||||
|
||||
EXPECT_TRUE(remaining.isEmpty());
|
||||
EXPECT_TRUE(remaining.IsEmpty());
|
||||
}
|
||||
|
||||
} // namespace LayerTestCommon
|
||||
|
@ -5,7 +5,6 @@
|
||||
#ifndef MockCCQuadCuller_h
|
||||
#define MockCCQuadCuller_h
|
||||
|
||||
#include "IntRect.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "cc/draw_quad.h"
|
||||
#include "cc/quad_sink.h"
|
||||
|
@ -92,7 +92,7 @@ TEST_F(TextureLayerTest, syncImplWhenChangingTextureId)
|
||||
|
||||
TEST_F(TextureLayerTest, syncImplWhenDrawing)
|
||||
{
|
||||
FloatRect dirtyRect(0, 0, 1, 1);
|
||||
gfx::RectF dirtyRect(0, 0, 1, 1);
|
||||
|
||||
scoped_refptr<TextureLayer> testLayer = TextureLayer::create(0);
|
||||
ASSERT_TRUE(testLayer);
|
||||
|
@ -148,9 +148,9 @@ void TiledLayer::updateBounds()
|
||||
m_tiler->setBounds(newBounds);
|
||||
|
||||
// Invalidate any areas that the new bounds exposes.
|
||||
Region oldRegion = IntRect(IntPoint(), cc::IntSize(oldBounds));
|
||||
Region newRegion = IntRect(IntPoint(), cc::IntSize(newBounds));
|
||||
newRegion.subtract(oldRegion);
|
||||
Region oldRegion = gfx::Rect(gfx::Point(), oldBounds);
|
||||
Region newRegion = gfx::Rect(gfx::Point(), newBounds);
|
||||
newRegion.Subtract(oldRegion);
|
||||
Vector<WebCore::IntRect> rects = newRegion.rects();
|
||||
for (size_t i = 0; i < rects.size(); ++i)
|
||||
invalidateContentRect(cc::IntRect(rects[i]));
|
||||
@ -329,7 +329,7 @@ bool TiledLayer::updateTiles(int left, int top, int right, int bottom, ResourceU
|
||||
gfx::Rect paintRect = markTilesForUpdate(left, top, right, bottom, ignoreOcclusions);
|
||||
|
||||
if (occlusion)
|
||||
occlusion->overdrawMetrics().didPaint(cc::IntRect(paintRect));
|
||||
occlusion->overdrawMetrics().didPaint(paintRect);
|
||||
|
||||
if (paintRect.IsEmpty())
|
||||
return true;
|
||||
@ -510,7 +510,7 @@ void TiledLayer::updateTileTextures(const gfx::Rect& paintRect, int left, int to
|
||||
|
||||
tile->updaterResource()->update(queue, sourceRect, destOffset, tile->partialUpdate, stats);
|
||||
if (occlusion)
|
||||
occlusion->overdrawMetrics().didUpload(WebTransformationMatrix(), cc::IntRect(sourceRect), cc::IntRect(tile->opaqueRect()));
|
||||
occlusion->overdrawMetrics().didUpload(WebTransformationMatrix(), sourceRect, tile->opaqueRect());
|
||||
|
||||
}
|
||||
}
|
||||
@ -592,7 +592,7 @@ Region TiledLayer::visibleContentOpaqueRegion() const
|
||||
if (m_skipsDraw)
|
||||
return Region();
|
||||
if (contentsOpaque())
|
||||
return cc::IntRect(visibleContentRect());
|
||||
return visibleContentRect();
|
||||
return m_tiler->opaqueRegionInContentRect(visibleContentRect());
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ Region TiledLayerImpl::visibleContentOpaqueRegion() const
|
||||
if (m_skipsDraw)
|
||||
return Region();
|
||||
if (contentsOpaque())
|
||||
return cc::IntRect(visibleContentRect());
|
||||
return visibleContentRect();
|
||||
return m_tiler->opaqueRegionInContentRect(visibleContentRect());
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ TEST_F(TiledLayerTest, pushOccludedDirtyTiles)
|
||||
// Invalidates part of the top tile...
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 50, 50));
|
||||
// ....but the area is occluded.
|
||||
occluded.setOcclusion(cc::IntRect(0, 0, 50, 50));
|
||||
occluded.setOcclusion(gfx::Rect(0, 0, 50, 50));
|
||||
updateAndPush(layer.get(), layerImpl.get());
|
||||
|
||||
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
|
||||
@ -433,7 +433,7 @@ TEST_F(TiledLayerTest, pushIdlePaintedOccludedTiles)
|
||||
m_occlusion = &occluded;
|
||||
|
||||
// The tile size is 100x100, so this invalidates one occluded tile, culls it during paint, but prepaints it.
|
||||
occluded.setOcclusion(cc::IntRect(0, 0, 100, 100));
|
||||
occluded.setOcclusion(gfx::Rect(0, 0, 100, 100));
|
||||
|
||||
layer->setBounds(gfx::Size(100, 100));
|
||||
layer->setVisibleContentRect(gfx::Rect(0, 0, 100, 100));
|
||||
@ -988,7 +988,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusion)
|
||||
|
||||
layer->setBounds(gfx::Size(600, 600));
|
||||
|
||||
occluded.setOcclusion(cc::IntRect(200, 200, 300, 100));
|
||||
occluded.setOcclusion(gfx::Rect(200, 200, 300, 100));
|
||||
layer->setDrawableContentRect(gfx::Rect(gfx::Point(), layer->contentBounds()));
|
||||
layer->setVisibleContentRect(gfx::Rect(gfx::Point(), layer->contentBounds()));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
@ -1006,7 +1006,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusion)
|
||||
layer->setTexturePriorities(m_priorityCalculator);
|
||||
m_textureManager->prioritizeTextures();
|
||||
|
||||
occluded.setOcclusion(cc::IntRect(250, 200, 300, 100));
|
||||
occluded.setOcclusion(gfx::Rect(250, 200, 300, 100));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
layer->update(*m_queue.get(), &occluded, m_stats);
|
||||
EXPECT_EQ(36-2, layer->fakeLayerUpdater()->updateCount());
|
||||
@ -1019,7 +1019,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusion)
|
||||
layer->setTexturePriorities(m_priorityCalculator);
|
||||
m_textureManager->prioritizeTextures();
|
||||
|
||||
occluded.setOcclusion(cc::IntRect(250, 250, 300, 100));
|
||||
occluded.setOcclusion(gfx::Rect(250, 250, 300, 100));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
layer->update(*m_queue.get(), &occluded, m_stats);
|
||||
EXPECT_EQ(36, layer->fakeLayerUpdater()->updateCount());
|
||||
@ -1039,7 +1039,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
|
||||
layer->setBounds(gfx::Size(600, 600));
|
||||
|
||||
// The partially occluded tiles (by the 150 occlusion height) are visible beyond the occlusion, so not culled.
|
||||
occluded.setOcclusion(cc::IntRect(200, 200, 300, 150));
|
||||
occluded.setOcclusion(gfx::Rect(200, 200, 300, 150));
|
||||
layer->setDrawableContentRect(gfx::Rect(0, 0, 600, 360));
|
||||
layer->setVisibleContentRect(gfx::Rect(0, 0, 600, 360));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
@ -1056,7 +1056,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
|
||||
layer->fakeLayerUpdater()->clearUpdateCount();
|
||||
|
||||
// Now the visible region stops at the edge of the occlusion so the partly visible tiles become fully occluded.
|
||||
occluded.setOcclusion(cc::IntRect(200, 200, 300, 150));
|
||||
occluded.setOcclusion(gfx::Rect(200, 200, 300, 150));
|
||||
layer->setDrawableContentRect(gfx::Rect(0, 0, 600, 350));
|
||||
layer->setVisibleContentRect(gfx::Rect(0, 0, 600, 350));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
@ -1072,7 +1072,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
|
||||
layer->fakeLayerUpdater()->clearUpdateCount();
|
||||
|
||||
// Now the visible region is even smaller than the occlusion, it should have the same result.
|
||||
occluded.setOcclusion(cc::IntRect(200, 200, 300, 150));
|
||||
occluded.setOcclusion(gfx::Rect(200, 200, 300, 150));
|
||||
layer->setDrawableContentRect(gfx::Rect(0, 0, 600, 340));
|
||||
layer->setVisibleContentRect(gfx::Rect(0, 0, 600, 340));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
@ -1096,7 +1096,7 @@ TEST_F(TiledLayerTest, tilesNotPaintedWithoutInvalidation)
|
||||
|
||||
layer->setBounds(gfx::Size(600, 600));
|
||||
|
||||
occluded.setOcclusion(cc::IntRect(200, 200, 300, 100));
|
||||
occluded.setOcclusion(gfx::Rect(200, 200, 300, 100));
|
||||
layer->setDrawableContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
layer->setVisibleContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
@ -1140,7 +1140,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndTransforms)
|
||||
layer->setScreenSpaceTransform(screenTransform);
|
||||
layer->setDrawTransform(screenTransform);
|
||||
|
||||
occluded.setOcclusion(cc::IntRect(100, 100, 150, 50));
|
||||
occluded.setOcclusion(gfx::Rect(100, 100, 150, 50));
|
||||
layer->setDrawableContentRect(gfx::Rect(gfx::Point(), layer->contentBounds()));
|
||||
layer->setVisibleContentRect(gfx::Rect(gfx::Point(), layer->contentBounds()));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
@ -1172,7 +1172,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndScaling)
|
||||
layer->setDrawTransform(drawTransform);
|
||||
layer->setScreenSpaceTransform(drawTransform);
|
||||
|
||||
occluded.setOcclusion(cc::IntRect(200, 200, 300, 100));
|
||||
occluded.setOcclusion(gfx::Rect(200, 200, 300, 100));
|
||||
layer->setDrawableContentRect(gfx::Rect(gfx::Point(), layer->bounds()));
|
||||
layer->setVisibleContentRect(gfx::Rect(gfx::Point(), layer->contentBounds()));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
@ -1193,7 +1193,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndScaling)
|
||||
// This makes sure the painting works when the content space is scaled to
|
||||
// a different layer space. In this case the occluded region catches the
|
||||
// blown up tiles.
|
||||
occluded.setOcclusion(cc::IntRect(200, 200, 300, 200));
|
||||
occluded.setOcclusion(gfx::Rect(200, 200, 300, 200));
|
||||
layer->setDrawableContentRect(gfx::Rect(gfx::Point(), layer->bounds()));
|
||||
layer->setVisibleContentRect(gfx::Rect(gfx::Point(), layer->contentBounds()));
|
||||
layer->invalidateContentRect(gfx::Rect(0, 0, 600, 600));
|
||||
@ -1214,7 +1214,7 @@ TEST_F(TiledLayerTest, tilesPaintedWithOcclusionAndScaling)
|
||||
layer->setScreenSpaceTransform(screenTransform);
|
||||
layer->setDrawTransform(screenTransform);
|
||||
|
||||
occluded.setOcclusion(cc::IntRect(100, 100, 150, 100));
|
||||
occluded.setOcclusion(gfx::Rect(100, 100, 150, 100));
|
||||
|
||||
gfx::Rect layerBoundsRect(gfx::Point(), layer->bounds());
|
||||
layer->setDrawableContentRect(gfx::ToEnclosingRect(gfx::ScaleRect(layerBoundsRect, 0.5)));
|
||||
@ -1256,7 +1256,7 @@ TEST_F(TiledLayerTest, visibleContentOpaqueRegion)
|
||||
layer->invalidateContentRect(contentBounds);
|
||||
layer->update(*m_queue.get(), &occluded, m_stats);
|
||||
opaqueContents = layer->visibleContentOpaqueRegion();
|
||||
EXPECT_TRUE(opaqueContents.isEmpty());
|
||||
EXPECT_TRUE(opaqueContents.IsEmpty());
|
||||
|
||||
EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 20000, 1);
|
||||
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
|
||||
@ -1349,7 +1349,7 @@ TEST_F(TiledLayerTest, pixelsPaintedMetrics)
|
||||
layer->update(*m_queue.get(), &occluded, m_stats);
|
||||
updateTextures();
|
||||
opaqueContents = layer->visibleContentOpaqueRegion();
|
||||
EXPECT_TRUE(opaqueContents.isEmpty());
|
||||
EXPECT_TRUE(opaqueContents.IsEmpty());
|
||||
|
||||
EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 30000, 1);
|
||||
EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
|
||||
@ -1364,7 +1364,7 @@ TEST_F(TiledLayerTest, pixelsPaintedMetrics)
|
||||
layer->update(*m_queue.get(), &occluded, m_stats);
|
||||
updateTextures();
|
||||
opaqueContents = layer->visibleContentOpaqueRegion();
|
||||
EXPECT_TRUE(opaqueContents.isEmpty());
|
||||
EXPECT_TRUE(opaqueContents.IsEmpty());
|
||||
|
||||
// The middle tile was painted even though not invalidated.
|
||||
EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 30000 + 60 * 210, 1);
|
||||
|
Reference in New Issue
Block a user