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

Unified Diff: cc/image_layer.cc

Issue 11266030: Use gfx:: Geometry types for the resource provider and layer updater classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: uint8 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/heads_up_display_layer_impl.cc ('k') | cc/layer_painter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/image_layer.cc
diff --git a/cc/image_layer.cc b/cc/image_layer.cc
index b3477367476817bbfdbe2d2699baef529daf0dae..e1620073e46a3db9c3e059e697decb0e347797e1 100644
--- a/cc/image_layer.cc
+++ b/cc/image_layer.cc
@@ -23,7 +23,7 @@ public:
{
}
- virtual void update(ResourceUpdateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE
+ virtual void update(ResourceUpdateQueue& queue, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats&) OVERRIDE
{
updater()->updateTexture(queue, texture(), sourceRect, destOffset, partialUpdate);
}
@@ -45,15 +45,15 @@ public:
return scoped_ptr<LayerUpdater::Resource>(new Resource(this, PrioritizedTexture::create(manager)));
}
- void updateTexture(ResourceUpdateQueue& queue, PrioritizedTexture* texture, const IntRect& sourceRect, const IntSize& destOffset, bool partialUpdate)
+ void updateTexture(ResourceUpdateQueue& queue, PrioritizedTexture* texture, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate)
{
// Source rect should never go outside the image pixels, even if this
// is requested because the texture extends outside the image.
- IntRect clippedSourceRect = sourceRect;
- IntRect imageRect = IntRect(0, 0, m_bitmap.width(), m_bitmap.height());
- clippedSourceRect.intersect(imageRect);
+ gfx::Rect clippedSourceRect = sourceRect;
+ gfx::Rect imageRect = gfx::Rect(0, 0, m_bitmap.width(), m_bitmap.height());
+ clippedSourceRect.Intersect(imageRect);
- IntSize clippedDestOffset = destOffset + IntSize(clippedSourceRect.location() - sourceRect.location());
+ gfx::Vector2d clippedDestOffset = destOffset + (clippedSourceRect.origin() - sourceRect.origin());
ResourceUpdate upload = ResourceUpdate::Create(texture,
&m_bitmap,
« no previous file with comments | « cc/heads_up_display_layer_impl.cc ('k') | cc/layer_painter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698