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

Unified Diff: ui/views/controls/image_view.h

Issue 73893007: Makes ImageView do a bit more checking before assuming images equal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 7 years, 1 month 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 | « no previous file | ui/views/controls/image_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/image_view.h
diff --git a/ui/views/controls/image_view.h b/ui/views/controls/image_view.h
index 18c4ba13241ac01afe2d2604b3e361350dd32de5..b40cb83461f7c94a9cae9ab23ddd19a7fbfaa8fb 100644
--- a/ui/views/controls/image_view.h
+++ b/ui/views/controls/image_view.h
@@ -84,6 +84,11 @@ class VIEWS_EXPORT ImageView : public View {
virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE;
private:
+ // Returns true if |img| is the same as the last image we painted. This is
+ // intended to be a quick check, not exhaustive. In other words it's possible
+ // for this to return false even though the images are in fact equal.
+ bool IsImageEqual(const gfx::ImageSkia& img) const;
+
// Compute the image origin given the desired size and the receiver alignment
// properties.
gfx::Point ComputeImageOrigin(const gfx::Size& image_size) const;
@@ -109,6 +114,13 @@ class VIEWS_EXPORT ImageView : public View {
// A flag controlling hit test handling for interactivity.
bool interactive_;
+ // Scale last painted at.
+ float last_paint_scale_;
+
+ // Address of bytes we last painted. This is used only for comparison, so its
+ // safe to cache.
+ void* last_painted_bitmap_pixels_;
+
DISALLOW_COPY_AND_ASSIGN(ImageView);
};
« no previous file with comments | « no previous file | ui/views/controls/image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698