OLD | NEW |
---|---|
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_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... | |
38 return render_widget_host_; | 38 return render_widget_host_; |
39 } | 39 } |
40 const gfx::Size& size() { return size_; } | 40 const gfx::Size& size() { return size_; } |
41 | 41 |
42 // The number of bytes that this backing store consumes. The default | 42 // The number of bytes that this backing store consumes. The default |
43 // implementation just assumes there's 32 bits per pixel over the current | 43 // implementation just assumes there's 32 bits per pixel over the current |
44 // size of the screen. Implementations may override this if they have more | 44 // size of the screen. Implementations may override this if they have more |
45 // information about the color depth. | 45 // information about the color depth. |
46 virtual size_t MemorySize(); | 46 virtual size_t MemorySize(); |
47 | 47 |
48 // Paints the bitmap from the renderer onto the backing store. bitmap_rect | 48 // Paints the bitmap from the renderer onto the backing store. bitmap_rect |
Avi (use Gerrit)
2012/06/13 20:44:40
One space after period to match rest of comment.
Nico
2012/06/13 20:46:58
Done.
| |
49 // gives the location of bitmap, and copy_rects specifies the subregion(s) of | 49 // gives the location of bitmap, and copy_rects specifies the subregion(s) of |
50 // the backingstore to be painted from the bitmap. | 50 // the backingstore to be painted from the bitmap. All coordinates are in |
51 // DIPs. |scale_factor| contains the expected device scale factor of the | |
52 // backing store. | |
51 // | 53 // |
52 // PaintToBackingStore does not need to guarantee that this has happened by | 54 // PaintToBackingStore does not need to guarantee that this has happened by |
53 // the time it returns, in which case it will set |scheduled_callback| to | 55 // the time it returns, in which case it will set |scheduled_callback| to |
54 // true and will call |callback| when completed. | 56 // true and will call |callback| when completed. |
55 virtual void PaintToBackingStore( | 57 virtual void PaintToBackingStore( |
56 content::RenderProcessHost* process, | 58 content::RenderProcessHost* process, |
57 TransportDIB::Id bitmap, | 59 TransportDIB::Id bitmap, |
58 const gfx::Rect& bitmap_rect, | 60 const gfx::Rect& bitmap_rect, |
59 const std::vector<gfx::Rect>& copy_rects, | 61 const std::vector<gfx::Rect>& copy_rects, |
62 float scale_factor, | |
60 const base::Closure& completion_callback, | 63 const base::Closure& completion_callback, |
61 bool* scheduled_completion_callback) = 0; | 64 bool* scheduled_completion_callback) = 0; |
62 | 65 |
63 // Extracts the gives subset of the backing store and copies it to the given | 66 // Extracts the gives subset of the backing store and copies it to the given |
64 // PlatformCanvas. The PlatformCanvas should not be initialized. This function | 67 // PlatformCanvas. The PlatformCanvas should not be initialized. This function |
65 // will call initialize() with the correct size. The return value indicates | 68 // will call initialize() with the correct size. The return value indicates |
66 // success. | 69 // success. |
67 virtual bool CopyFromBackingStore(const gfx::Rect& rect, | 70 virtual bool CopyFromBackingStore(const gfx::Rect& rect, |
68 skia::PlatformCanvas* output) = 0; | 71 skia::PlatformCanvas* output) = 0; |
69 | 72 |
(...skipping 10 matching lines...) Expand all Loading... | |
80 // The owner of this backing store. | 83 // The owner of this backing store. |
81 content::RenderWidgetHost* render_widget_host_; | 84 content::RenderWidgetHost* render_widget_host_; |
82 | 85 |
83 // The size of the backing store. | 86 // The size of the backing store. |
84 gfx::Size size_; | 87 gfx::Size size_; |
85 | 88 |
86 DISALLOW_COPY_AND_ASSIGN(BackingStore); | 89 DISALLOW_COPY_AND_ASSIGN(BackingStore); |
87 }; | 90 }; |
88 | 91 |
89 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_ | 92 #endif // CONTENT_BROWSER_RENDERER_HOST_BACKING_STORE_H_ |
OLD | NEW |