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

Unified Diff: chrome/browser/renderer_host/backing_store_x.cc

Issue 146095: change backing store cache to be memory-based rather than count (Closed)
Patch Set: added better MemorySize() and comments Created 11 years, 6 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
Index: chrome/browser/renderer_host/backing_store_x.cc
diff --git a/chrome/browser/renderer_host/backing_store_x.cc b/chrome/browser/renderer_host/backing_store_x.cc
index a2397a2dd3857465a3b85a3dc1eae40377987616..eb7663633f35accc6c5a1be77a98be573ad5f6b5 100644
--- a/chrome/browser/renderer_host/backing_store_x.cc
+++ b/chrome/browser/renderer_host/backing_store_x.cc
@@ -77,6 +77,13 @@ BackingStore::~BackingStore() {
XFreeGC(display_, static_cast<GC>(pixmap_gc_));
}
+size_t BackingStore::MemorySize() {
+ if (use_render_)
agl 2009/06/24 18:53:01 !use_render_
+ return size_.GetArea() * (pixmap_bpp_ / 8);
+ else
+ return size_.GetArea() * 4; // TODO(port) is this correct?
agl 2009/06/24 18:53:01 Yes it is, remove TODO
+}
+
void BackingStore::PaintRectWithoutXrender(TransportDIB* bitmap,
const gfx::Rect &bitmap_rect) {
const int width = bitmap_rect.width();

Powered by Google App Engine
This is Rietveld 408576698