| Index: cc/CCRendererGL.cpp
|
| diff --git a/cc/CCRendererGL.cpp b/cc/CCRendererGL.cpp
|
| index 50fed7abcf40c750d65b5087d4ec73b8e9b4c65e..86f0d14da8454f009140009b56d52eca49f0d6fc 100644
|
| --- a/cc/CCRendererGL.cpp
|
| +++ b/cc/CCRendererGL.cpp
|
| @@ -379,7 +379,9 @@ PassOwnPtr<CCScopedTexture> CCRendererGL::drawBackgroundFilters(DrawingFrame& fr
|
| deviceRect.move(-left, -top);
|
| deviceRect.expand(left + right, top + bottom);
|
|
|
| - deviceRect.intersect(frame.currentRenderPass->outputRect());
|
| + deviceRect.intersect(static_cast<IntRect>(frame.currentRenderPass->outputRect()));
|
| +
|
| + IntRect quadRect = quad->quadRect();
|
|
|
| OwnPtr<CCScopedTexture> deviceBackgroundTexture = CCScopedTexture::create(m_resourceProvider);
|
| if (!getFramebufferTexture(deviceBackgroundTexture.get(), deviceRect))
|
| @@ -393,17 +395,17 @@ PassOwnPtr<CCScopedTexture> CCRendererGL::drawBackgroundFilters(DrawingFrame& fr
|
| int filteredDeviceBackgroundTextureId = texture->getTextureHandle();
|
|
|
| OwnPtr<CCScopedTexture> backgroundTexture = CCScopedTexture::create(m_resourceProvider);
|
| - if (!backgroundTexture->allocate(CCRenderer::ImplPool, quad->quadRect().size(), GraphicsContext3D::RGBA, CCResourceProvider::TextureUsageFramebuffer))
|
| + if (!backgroundTexture->allocate(CCRenderer::ImplPool, quadRect.size(), GraphicsContext3D::RGBA, CCResourceProvider::TextureUsageFramebuffer))
|
| return nullptr;
|
|
|
| const CCRenderPass* targetRenderPass = frame.currentRenderPass;
|
| - bool usingBackgroundTexture = useScopedTexture(frame, backgroundTexture.get(), quad->quadRect());
|
| + bool usingBackgroundTexture = useScopedTexture(frame, backgroundTexture.get(), quadRect);
|
|
|
| if (usingBackgroundTexture) {
|
| // Copy the readback pixels from device to the background texture for the surface.
|
| WebTransformationMatrix deviceToFramebufferTransform;
|
| - deviceToFramebufferTransform.translate(quad->quadRect().width() / 2.0, quad->quadRect().height() / 2.0);
|
| - deviceToFramebufferTransform.scale3d(quad->quadRect().width(), quad->quadRect().height(), 1);
|
| + deviceToFramebufferTransform.translate(quadRect.width() / 2.0, quadRect.height() / 2.0);
|
| + deviceToFramebufferTransform.scale3d(quadRect.width(), quadRect.height(), 1);
|
| deviceToFramebufferTransform.multiply(contentsDeviceTransform.inverse());
|
| copyTextureToFramebuffer(frame, filteredDeviceBackgroundTextureId, deviceRect, deviceToFramebufferTransform);
|
| }
|
| @@ -426,10 +428,12 @@ void CCRendererGL::drawRenderPassQuad(DrawingFrame& frame, const CCRenderPassDra
|
| if (!renderPass)
|
| return;
|
|
|
| + IntRect quadRect = quad->quadRect();
|
| +
|
| WebTransformationMatrix renderMatrix = quad->quadTransform();
|
| - renderMatrix.translate(0.5 * quad->quadRect().width() + quad->quadRect().x(), 0.5 * quad->quadRect().height() + quad->quadRect().y());
|
| + renderMatrix.translate(0.5 * quadRect.width() + quadRect.x(), 0.5 * quadRect.height() + quadRect.y());
|
| WebTransformationMatrix deviceMatrix = renderMatrix;
|
| - deviceMatrix.scaleNonUniform(quad->quadRect().width(), quad->quadRect().height());
|
| + deviceMatrix.scaleNonUniform(quadRect.width(), quadRect.height());
|
| WebTransformationMatrix contentsDeviceTransform = WebTransformationMatrix(frame.windowMatrix * frame.projectionMatrix * deviceMatrix).to2dTransform();
|
|
|
| // Can only draw surface if device matrix is invertible.
|
| @@ -453,9 +457,9 @@ void CCRendererGL::drawRenderPassQuad(DrawingFrame& frame, const CCRenderPassDra
|
|
|
| // Draw the background texture if there is one.
|
| if (backgroundTexture) {
|
| - ASSERT(backgroundTexture->size() == quad->quadRect().size());
|
| + ASSERT(backgroundTexture->size() == quadRect.size());
|
| CCResourceProvider::ScopedReadLockGL lock(m_resourceProvider, backgroundTexture->id());
|
| - copyTextureToFramebuffer(frame, lock.textureId(), quad->quadRect(), quad->quadTransform());
|
| + copyTextureToFramebuffer(frame, lock.textureId(), quadRect, quad->quadTransform());
|
| }
|
|
|
| bool clipped = false;
|
| @@ -554,7 +558,7 @@ void CCRendererGL::drawRenderPassQuad(DrawingFrame& frame, const CCRenderPassDra
|
|
|
| setShaderOpacity(quad->opacity(), shaderAlphaLocation);
|
| setShaderFloatQuad(surfaceQuad, shaderQuadLocation);
|
| - drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), shaderMatrixLocation);
|
| + drawQuadGeometry(frame, quad->quadTransform(), quadRect, shaderMatrixLocation);
|
| }
|
|
|
| void CCRendererGL::drawSolidColorQuad(const DrawingFrame& frame, const CCSolidColorDrawQuad* quad)
|
| @@ -598,6 +602,7 @@ static void tileUniformLocation(T program, TileProgramUniforms& uniforms)
|
|
|
| void CCRendererGL::drawTileQuad(const DrawingFrame& frame, const CCTileDrawQuad* quad)
|
| {
|
| + IntRect quadRect = quad->quadRect();
|
| IntRect tileRect = quad->quadVisibleRect();
|
|
|
| FloatRect clampRect(tileRect);
|
| @@ -614,8 +619,8 @@ void CCRendererGL::drawTileQuad(const DrawingFrame& frame, const CCTileDrawQuad*
|
| clampRect.inflateY(-clampY);
|
| FloatSize clampOffset = clampRect.minXMinYCorner() - FloatRect(tileRect).minXMinYCorner();
|
|
|
| - FloatPoint textureOffset = quad->textureOffset() + clampOffset +
|
| - IntPoint(tileRect.location() - quad->quadRect().location());
|
| + FloatPoint textureOffset = static_cast<IntPoint>(quad->textureOffset()) + clampOffset +
|
| + IntPoint(tileRect.location() - quadRect.location());
|
|
|
| // Map clamping rectangle to unit square.
|
| float vertexTexTranslateX = -clampRect.x() / clampRect.width();
|
| @@ -624,7 +629,7 @@ void CCRendererGL::drawTileQuad(const DrawingFrame& frame, const CCTileDrawQuad*
|
| float vertexTexScaleY = tileRect.height() / clampRect.height();
|
|
|
| // Map to normalized texture coordinates.
|
| - const IntSize& textureSize = quad->textureSize();
|
| + IntSize textureSize = quad->textureSize();
|
| float fragmentTexTranslateX = textureOffset.x() / textureSize.width();
|
| float fragmentTexTranslateY = textureOffset.y() / textureSize.height();
|
| float fragmentTexScaleX = clampRect.width() / textureSize.width();
|
| @@ -637,7 +642,7 @@ void CCRendererGL::drawTileQuad(const DrawingFrame& frame, const CCTileDrawQuad*
|
| return;
|
|
|
| bool clipped = false;
|
| - FloatQuad deviceLayerQuad = CCMathUtil::mapQuad(deviceTransform, FloatQuad(quad->visibleContentRect()), clipped);
|
| + FloatQuad deviceLayerQuad = CCMathUtil::mapQuad(deviceTransform, FloatQuad(static_cast<IntRect>(quad->visibleContentRect())), clipped);
|
| ASSERT(!clipped);
|
|
|
| TileProgramUniforms uniforms;
|
| @@ -707,13 +712,13 @@ void CCRendererGL::drawTileQuad(const DrawingFrame& frame, const CCTileDrawQuad*
|
| CCLayerQuad::Edge rightEdge(topRight, bottomRight);
|
|
|
| // Only apply anti-aliasing to edges not clipped by culling or scissoring.
|
| - if (quad->topEdgeAA() && tileRect.y() == quad->quadRect().y())
|
| + if (quad->topEdgeAA() && tileRect.y() == quadRect.y())
|
| topEdge = deviceLayerEdges.top();
|
| - if (quad->leftEdgeAA() && tileRect.x() == quad->quadRect().x())
|
| + if (quad->leftEdgeAA() && tileRect.x() == quadRect.x())
|
| leftEdge = deviceLayerEdges.left();
|
| - if (quad->rightEdgeAA() && tileRect.maxX() == quad->quadRect().maxX())
|
| + if (quad->rightEdgeAA() && tileRect.maxX() == quadRect.maxX())
|
| rightEdge = deviceLayerEdges.right();
|
| - if (quad->bottomEdgeAA() && tileRect.maxY() == quad->quadRect().maxY())
|
| + if (quad->bottomEdgeAA() && tileRect.maxY() == quadRect.maxY())
|
| bottomEdge = deviceLayerEdges.bottom();
|
|
|
| float sign = FloatQuad(tileRect).isCounterclockwise() ? -1 : 1;
|
| @@ -906,7 +911,7 @@ void CCRendererGL::drawTextureQuad(const DrawingFrame& frame, const CCTextureDra
|
| }
|
|
|
| setShaderOpacity(quad->opacity(), binding.alphaLocation);
|
| - drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), binding.matrixLocation);
|
| + drawQuadGeometry(frame, quad->quadTransform(), static_cast<IntRect>(quad->quadRect()), binding.matrixLocation);
|
|
|
| if (!quad->premultipliedAlpha())
|
| GLC(m_context, m_context->blendFunc(GraphicsContext3D::ONE, GraphicsContext3D::ONE_MINUS_SRC_ALPHA));
|
|
|