OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 // | 36 // |
37 // backing_store_size | 37 // backing_store_size |
38 // The desired backing store dimensions. | 38 // The desired backing store dimensions. |
39 // bitmap_section | 39 // bitmap_section |
40 // The bitmap section from the renderer. | 40 // The bitmap section from the renderer. |
41 // bitmap_rect | 41 // bitmap_rect |
42 // The rect to be painted into the backing store | 42 // The rect to be painted into the backing store |
43 // needs_full_paint | 43 // needs_full_paint |
44 // Set if we need to send out a request to paint the view | 44 // Set if we need to send out a request to paint the view |
45 // to the renderer. | 45 // to the renderer. |
46 // painted_synchronously | |
47 // Will be set by the function if the request was processed synchronously, | |
48 // and the bitmap is done being used. False means that the backing store | |
49 // will paint the bitmap at a later time and that the TransportDIB can't be | |
50 // freed (it will be the backing store's job to free it later). | |
51 static void PrepareBackingStore( | 46 static void PrepareBackingStore( |
52 RenderWidgetHost* host, | 47 RenderWidgetHost* host, |
53 const gfx::Size& backing_store_size, | 48 const gfx::Size& backing_store_size, |
54 TransportDIB::Id bitmap, | 49 TransportDIB::Id bitmap, |
55 const gfx::Rect& bitmap_rect, | 50 const gfx::Rect& bitmap_rect, |
56 const std::vector<gfx::Rect>& copy_rects, | 51 const std::vector<gfx::Rect>& copy_rects, |
57 bool* needs_full_paint, | 52 bool* needs_full_paint); |
58 bool* painted_synchronously); | |
59 | 53 |
60 // Returns a matching backing store for the host. | 54 // Returns a matching backing store for the host. |
61 // Returns NULL if we fail to find one. | 55 // Returns NULL if we fail to find one. |
62 static BackingStore* Lookup(RenderWidgetHost* host); | 56 static BackingStore* Lookup(RenderWidgetHost* host); |
63 | 57 |
64 // Removes the backing store for the host. | 58 // Removes the backing store for the host. |
65 static void RemoveBackingStore(RenderWidgetHost* host); | 59 static void RemoveBackingStore(RenderWidgetHost* host); |
66 | 60 |
67 // Removes all backing stores. | 61 // Removes all backing stores. |
68 static void RemoveAllBackingStores(); | 62 static void RemoveAllBackingStores(); |
69 | 63 |
70 // Expires the given backing store. This emulates something getting evicted | 64 // Expires the given backing store. This emulates something getting evicted |
71 // from the cache for the purpose of testing. Returns true if the host was | 65 // from the cache for the purpose of testing. Returns true if the host was |
72 // removed, false if it wasn't found. | 66 // removed, false if it wasn't found. |
73 static bool ExpireBackingStoreForTest(RenderWidgetHost* host); | 67 static bool ExpireBackingStoreForTest(RenderWidgetHost* host); |
74 | 68 |
75 // Current size in bytes of the backing store cache. | 69 // Current size in bytes of the backing store cache. |
76 static size_t MemorySize(); | 70 static size_t MemorySize(); |
77 | 71 |
78 private: | 72 private: |
79 // Not intended for instantiation. | 73 // Not intended for instantiation. |
80 BackingStoreManager() {} | 74 BackingStoreManager() {} |
81 | 75 |
82 DISALLOW_COPY_AND_ASSIGN(BackingStoreManager); | 76 DISALLOW_COPY_AND_ASSIGN(BackingStoreManager); |
83 }; | 77 }; |
84 | 78 |
85 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ | 79 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ |
OLD | NEW |