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

Unified Diff: Source/core/page/ImageBitmap.h

Issue 22613002: Allow ImageBitmaps derived from HTMLImageElements to be evicted from RAM. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make destructor virtual. Created 7 years, 4 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 | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/page/ImageBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/ImageBitmap.h
diff --git a/Source/core/page/ImageBitmap.h b/Source/core/page/ImageBitmap.h
index 102fa62542e219b514d12426121c2d17085a8e52..5b91a5f618ae9eb6b5f4909720696cc2e243e19e 100644
--- a/Source/core/page/ImageBitmap.h
+++ b/Source/core/page/ImageBitmap.h
@@ -32,12 +32,13 @@ public:
PassRefPtr<HTMLImageElement> imageElement() const { return m_imageElement; }
IntRect bitmapRect() const { return m_bitmapRect; }
+ IntPoint bitmapOffset() const { return m_bitmapOffset; }
int width() const { return m_cropRect.width(); }
int height() const { return m_cropRect.height(); }
IntSize size() const { return m_cropRect.size(); }
- ~ImageBitmap();
+ virtual ~ImageBitmap();
private:
ImageBitmap(HTMLImageElement*, const IntRect&);
@@ -58,6 +59,12 @@ private:
IntRect m_bitmapRect; // The rect where the underlying Image should be placed in reference to the ImageBitmap.
IntRect m_cropRect;
+
+ // The offset by which the desired Image is stored internally.
+ // ImageBitmaps constructed from HTMLImageElements reference the entire CachedImage and may have a non-zero bitmap offset.
+ // ImageBitmaps not constructed from HTMLImageElements always pre-crop and store the image at (0, 0).
+ IntPoint m_bitmapOffset;
+
};
} // namespace WebCore
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/page/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698