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

Side by Side Diff: content/browser/renderer_host/backing_store_manager.h

Issue 10540144: Tag TransportDIBs with the device scale factor they expect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 21 matching lines...) Expand all
32 // backing_store_rect 32 // backing_store_rect
33 // The desired backing store dimensions. 33 // The desired backing store dimensions.
34 // Returns a pointer to the backing store on success, NULL on failure. 34 // Returns a pointer to the backing store on success, NULL on failure.
35 static BackingStore* GetBackingStore(content::RenderWidgetHost* host, 35 static BackingStore* GetBackingStore(content::RenderWidgetHost* host,
36 const gfx::Size& desired_size); 36 const gfx::Size& desired_size);
37 37
38 // Makes a backing store which is fully ready for consumption, i.e. the 38 // Makes a backing store which is fully ready for consumption, i.e. the
39 // bitmap from the renderer has been copied into the backing store. 39 // bitmap from the renderer has been copied into the backing store.
40 // 40 //
41 // backing_store_size 41 // backing_store_size
42 // The desired backing store dimensions. 42 // The desired backing store dimensions, in DIPs.
43 // bitmap_section 43 // bitmap_section
44 // The bitmap section from the renderer. 44 // The bitmap section from the renderer.
45 // bitmap_rect 45 // bitmap_rect
46 // The rect to be painted into the backing store 46 // The rect to be painted into the backing store, in DIPs.
47 // scale_factor
48 // The device scale facctor the backing store is expected to be at.
Avi (use Gerrit) 2012/06/13 20:44:40 s/facctor/factor/
49 // If the backing store's device scale factor doesn't match, it will need
50 // to scale |bitmap| at paint time. This will only be out of sync with the
51 // backing store scale factor for a few frames, right after device scale
52 // changes.
47 // needs_full_paint 53 // needs_full_paint
48 // Set if we need to send out a request to paint the view 54 // Set if we need to send out a request to paint the view
49 // to the renderer. 55 // to the renderer.
50 static void PrepareBackingStore( 56 static void PrepareBackingStore(
51 content::RenderWidgetHost* host, 57 content::RenderWidgetHost* host,
52 const gfx::Size& backing_store_size, 58 const gfx::Size& backing_store_size,
53 TransportDIB::Id bitmap, 59 TransportDIB::Id bitmap,
54 const gfx::Rect& bitmap_rect, 60 const gfx::Rect& bitmap_rect,
55 const std::vector<gfx::Rect>& copy_rects, 61 const std::vector<gfx::Rect>& copy_rects,
62 float scale_factor,
56 const base::Closure& completion_callback, 63 const base::Closure& completion_callback,
57 bool* needs_full_paint, 64 bool* needs_full_paint,
58 bool* scheduled_completion_callback); 65 bool* scheduled_completion_callback);
59 66
60 // Returns a matching backing store for the host. 67 // Returns a matching backing store for the host.
61 // Returns NULL if we fail to find one. 68 // Returns NULL if we fail to find one.
62 static BackingStore* Lookup(content::RenderWidgetHost* host); 69 static BackingStore* Lookup(content::RenderWidgetHost* host);
63 70
64 // Removes the backing store for the host. 71 // Removes the backing store for the host.
65 static void RemoveBackingStore(content::RenderWidgetHost* host); 72 static void RemoveBackingStore(content::RenderWidgetHost* host);
66 73
67 // Removes all backing stores. 74 // Removes all backing stores.
68 static void RemoveAllBackingStores(); 75 static void RemoveAllBackingStores();
69 76
70 // Current size in bytes of the backing store cache. 77 // Current size in bytes of the backing store cache.
71 static size_t MemorySize(); 78 static size_t MemorySize();
72 79
73 private: 80 private:
74 // Not intended for instantiation. 81 // Not intended for instantiation.
75 BackingStoreManager() {} 82 BackingStoreManager() {}
76 83
77 DISALLOW_COPY_AND_ASSIGN(BackingStoreManager); 84 DISALLOW_COPY_AND_ASSIGN(BackingStoreManager);
78 }; 85 };
79 86
80 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_ 87 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698