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

Side by Side Diff: chrome/browser/renderer_host/backing_store.h

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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_
6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "base/gfx/size.h" 10 #include "base/gfx/size.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 // This is for unittesting only. An object constructed using this constructor 43 // This is for unittesting only. An object constructed using this constructor
44 // will silently ignore all paints 44 // will silently ignore all paints
45 BackingStore(RenderWidgetHost* widget, const gfx::Size& size); 45 BackingStore(RenderWidgetHost* widget, const gfx::Size& size);
46 #endif 46 #endif
47 ~BackingStore(); 47 ~BackingStore();
48 48
49 RenderWidgetHost* render_widget_host() const { return render_widget_host_; } 49 RenderWidgetHost* render_widget_host() const { return render_widget_host_; }
50 const gfx::Size& size() { return size_; } 50 const gfx::Size& size() { return size_; }
51 51
52 // The number of bytes that this backing store consumes. This should rougly
darin (slow to review) 2009/06/24 22:21:24 nit: roughly
53 // be size_.GetArea() * bytes per pixel.
54 size_t MemorySize();
55
52 #if defined(OS_WIN) 56 #if defined(OS_WIN)
53 HDC hdc() { return hdc_; } 57 HDC hdc() { return hdc_; }
54 58
55 // Returns true if we should convert to the monitor profile when painting. 59 // Returns true if we should convert to the monitor profile when painting.
56 static bool ColorManagementEnabled(); 60 static bool ColorManagementEnabled();
57 #elif defined(OS_MACOSX) 61 #elif defined(OS_MACOSX)
58 skia::PlatformCanvas* canvas() { return &canvas_; } 62 skia::PlatformCanvas* canvas() { return &canvas_; }
59 #elif defined(OS_LINUX) 63 #elif defined(OS_LINUX)
60 Display* display() const { return display_; } 64 Display* display() const { return display_; }
61 XID root_window() const { return root_window_; }; 65 XID root_window() const { return root_window_; };
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // This is the RENDER picture pointing at |pixmap_|. 133 // This is the RENDER picture pointing at |pixmap_|.
130 XID picture_; 134 XID picture_;
131 // This is a default graphic context, used in XCopyArea 135 // This is a default graphic context, used in XCopyArea
132 void* pixmap_gc_; 136 void* pixmap_gc_;
133 #endif 137 #endif
134 138
135 DISALLOW_COPY_AND_ASSIGN(BackingStore); 139 DISALLOW_COPY_AND_ASSIGN(BackingStore);
136 }; 140 };
137 141
138 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_ 142 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698