Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(716)

Unified Diff: cc/gl_renderer.cc

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: some missed intstuff Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/gl_renderer.h ('k') | cc/gl_renderer_unittest.cc » ('j') | cc/layer_quad.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/gl_renderer.cc
diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc
index 7383d247bdec4ccc43d20019f368c4feefcbd447..917b99fd59cce9ba2b19e29166c89c0a4cc1a494 100644
--- a/cc/gl_renderer.cc
+++ b/cc/gl_renderer.cc
@@ -456,7 +456,7 @@ scoped_ptr<ScopedTexture> GLRenderer::drawBackgroundFilters(DrawingFrame& frame,
deviceRect.Intersect(frame.currentRenderPass->outputRect());
scoped_ptr<ScopedTexture> deviceBackgroundTexture = ScopedTexture::create(m_resourceProvider);
- if (!getFramebufferTexture(deviceBackgroundTexture.get(), cc::IntRect(deviceRect)))
+ if (!getFramebufferTexture(deviceBackgroundTexture.get(), deviceRect))
return scoped_ptr<ScopedTexture>();
SkBitmap filteredDeviceBackground = applyFilters(this, filters, deviceBackgroundTexture.get());
@@ -690,8 +690,8 @@ void GLRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQuad* qua
clampRect.Inset(clampX, clampY, clampX, clampY);
gfx::Vector2dF clampOffset = clampRect.origin() - tileRect.origin();
- gfx::PointF textureOffset = quad->textureOffset() + clampOffset +
- (tileRect.origin() - quad->quadRect().origin());
+ gfx::Vector2dF textureOffset = quad->textureOffset() + clampOffset +
+ (tileRect.origin() - quad->quadRect().origin());
// Map clamping rectangle to unit square.
float vertexTexTranslateX = -clampRect.x() / clampRect.width();
@@ -762,10 +762,10 @@ void GLRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQuad* qua
GLC(context(), context()->uniform4f(uniforms.vertexTexTransformLocation, vertexTexTranslateX, vertexTexTranslateY, vertexTexScaleX, vertexTexScaleY));
GLC(context(), context()->uniform4f(uniforms.fragmentTexTransformLocation, fragmentTexTranslateX, fragmentTexTranslateY, fragmentTexScaleX, fragmentTexScaleY));
- FloatPoint bottomRight(tileRect.right(), tileRect.bottom());
- FloatPoint bottomLeft(tileRect.x(), tileRect.bottom());
- FloatPoint topLeft(tileRect.x(), tileRect.y());
- FloatPoint topRight(tileRect.right(), tileRect.y());
+ gfx::PointF bottomRight(tileRect.right(), tileRect.bottom());
+ gfx::PointF bottomLeft(tileRect.x(), tileRect.bottom());
+ gfx::PointF topLeft(tileRect.x(), tileRect.y());
+ gfx::PointF topRight(tileRect.right(), tileRect.y());
// Map points to device space.
bottomRight = MathUtil::mapPoint(deviceTransform, bottomRight, clipped);
@@ -1199,10 +1199,10 @@ void GLRenderer::onContextLost()
}
-void GLRenderer::getFramebufferPixels(void *pixels, const IntRect& rect)
+void GLRenderer::getFramebufferPixels(void *pixels, const gfx::Rect& rect)
{
- DCHECK(rect.maxX() <= viewportWidth());
- DCHECK(rect.maxY() <= viewportHeight());
+ DCHECK(rect.right() <= viewportWidth());
+ DCHECK(rect.bottom() <= viewportHeight());
if (!pixels)
return;
@@ -1237,8 +1237,8 @@ void GLRenderer::getFramebufferPixels(void *pixels, const IntRect& rect)
}
scoped_array<uint8_t> srcPixels(new uint8_t[rect.width() * rect.height() * 4]);
- GLC(m_context, m_context->readPixels(rect.x(), viewportSize().height() - rect.maxY(), rect.width(), rect.height(),
- GL_RGBA, GL_UNSIGNED_BYTE, srcPixels.get()));
+ GLC(m_context, m_context->readPixels(rect.x(), viewportSize().height() - rect.bottom(), rect.width(), rect.height(),
+ GL_RGBA, GL_UNSIGNED_BYTE, srcPixels.get()));
uint8_t* destPixels = static_cast<uint8_t*>(pixels);
size_t rowBytes = rect.width() * 4;
@@ -1267,11 +1267,11 @@ void GLRenderer::getFramebufferPixels(void *pixels, const IntRect& rect)
enforceMemoryPolicy();
}
-bool GLRenderer::getFramebufferTexture(ScopedTexture* texture, const IntRect& deviceRect)
+bool GLRenderer::getFramebufferTexture(ScopedTexture* texture, const gfx::Rect& deviceRect)
{
DCHECK(!texture->id() || (texture->size() == deviceRect.size() && texture->format() == GL_RGB));
- if (!texture->id() && !texture->allocate(Renderer::ImplPool, cc::IntSize(deviceRect.size()), GL_RGB, ResourceProvider::TextureUsageAny))
+ if (!texture->id() && !texture->allocate(Renderer::ImplPool, deviceRect.size(), GL_RGB, ResourceProvider::TextureUsageAny))
return false;
ResourceProvider::ScopedWriteLockGL lock(m_resourceProvider, texture->id());
« no previous file with comments | « cc/gl_renderer.h ('k') | cc/gl_renderer_unittest.cc » ('j') | cc/layer_quad.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698