summaryrefslogtreecommitdiffstats
path: root/cc/damage_tracker.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 18:15:58 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 18:15:58 +0000
commitaad0a007e1cd343892d7b13ce5ea8d90e8ef7f53 (patch)
tree24c9af166977bbf8f25aa5b129defb35f3f8ec05 /cc/damage_tracker.h
parent33432d8c37e3b929c60097c1eb7a53b13f364fb5 (diff)
downloadchromium_src-aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53.zip
chromium_src-aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53.tar.gz
chromium_src-aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53.tar.bz2
cc: Use gfx:: Geometry types for positions, bounds, and related things.
This covers layers, layer tree hosts, and related classes. *phew* I intentionally avoided anything to do with scrolling or page scale. Those should be changed to be Vectors and need a bit more thought. This change should be pretty mindless. It converts to gfx Rect, Size, Vector, and Point classes. No change is made for FloatPoint3D or FloatQuad yet. I've added cc/geometry.h as a place for free functions that don't exist on gfx types yet, and that we should port over in the future. No change in behaviour; covered by existing tests. BUG=147395 R=enne Review URL: https://codereview.chromium.org/11264056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/damage_tracker.h')
-rw-r--r--cc/damage_tracker.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/cc/damage_tracker.h b/cc/damage_tracker.h
index 59a13401..4680662b 100644
--- a/cc/damage_tracker.h
+++ b/cc/damage_tracker.h
@@ -7,15 +7,19 @@
#include "base/hash_tables.h"
#include "base/memory/scoped_ptr.h"
-#include "FloatRect.h"
+#include "ui/gfx/rect_f.h"
#include <vector>
+class SkImageFilter;
+
+namespace gfx {
+class Rect;
+}
+
namespace WebKit {
class WebFilterOperations;
}
-class SkImageFilter;
-
namespace cc {
class LayerImpl;
@@ -28,34 +32,34 @@ public:
static scoped_ptr<DamageTracker> create();
~DamageTracker();
- void didDrawDamagedArea() { m_currentDamageRect = FloatRect(); }
+ void didDrawDamagedArea() { m_currentDamageRect = gfx::RectF(); }
void forceFullDamageNextUpdate() { m_forceFullDamageNextUpdate = true; }
- void updateDamageTrackingState(const std::vector<LayerImpl*>& layerList, int targetSurfaceLayerID, bool targetSurfacePropertyChangedOnlyFromDescendant, const IntRect& targetSurfaceContentRect, LayerImpl* targetSurfaceMaskLayer, const WebKit::WebFilterOperations&, SkImageFilter* filter);
+ void updateDamageTrackingState(const std::vector<LayerImpl*>& layerList, int targetSurfaceLayerID, bool targetSurfacePropertyChangedOnlyFromDescendant, const gfx::Rect& targetSurfaceContentRect, LayerImpl* targetSurfaceMaskLayer, const WebKit::WebFilterOperations&, SkImageFilter* filter);
- const FloatRect& currentDamageRect() { return m_currentDamageRect; }
+ const gfx::RectF& currentDamageRect() { return m_currentDamageRect; }
private:
DamageTracker();
- FloatRect trackDamageFromActiveLayers(const std::vector<LayerImpl*>& layerList, int targetSurfaceLayerID);
- FloatRect trackDamageFromSurfaceMask(LayerImpl* targetSurfaceMaskLayer);
- FloatRect trackDamageFromLeftoverRects();
+ gfx::RectF trackDamageFromActiveLayers(const std::vector<LayerImpl*>& layerList, int targetSurfaceLayerID);
+ gfx::RectF trackDamageFromSurfaceMask(LayerImpl* targetSurfaceMaskLayer);
+ gfx::RectF trackDamageFromLeftoverRects();
- FloatRect removeRectFromCurrentFrame(int layerID, bool& layerIsNew);
- void saveRectForNextFrame(int layerID, const FloatRect& targetSpaceRect);
+ gfx::RectF removeRectFromCurrentFrame(int layerID, bool& layerIsNew);
+ void saveRectForNextFrame(int layerID, const gfx::RectF& targetSpaceRect);
// These helper functions are used only in trackDamageFromActiveLayers().
- void extendDamageForLayer(LayerImpl*, FloatRect& targetDamageRect);
- void extendDamageForRenderSurface(LayerImpl*, FloatRect& targetDamageRect);
+ void extendDamageForLayer(LayerImpl*, gfx::RectF& targetDamageRect);
+ void extendDamageForRenderSurface(LayerImpl*, gfx::RectF& targetDamageRect);
// To correctly track exposed regions, two hashtables of rects are maintained.
// The "current" map is used to compute exposed regions of the current frame, while
// the "next" map is used to collect layer rects that are used in the next frame.
- typedef base::hash_map<int, FloatRect> RectMap;
+ typedef base::hash_map<int, gfx::RectF> RectMap;
scoped_ptr<RectMap> m_currentRectHistory;
scoped_ptr<RectMap> m_nextRectHistory;
- FloatRect m_currentDamageRect;
+ gfx::RectF m_currentDamageRect;
bool m_forceFullDamageNextUpdate;
};