OLD | NEW |
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
59 HDC hdc() { return hdc_; } | 59 HDC hdc() { return hdc_; } |
60 | 60 |
61 // Returns true if we should convert to the monitor profile when painting. | 61 // Returns true if we should convert to the monitor profile when painting. |
62 static bool ColorManagementEnabled(); | 62 static bool ColorManagementEnabled(); |
63 #elif defined(OS_MACOSX) | 63 #elif defined(OS_MACOSX) |
64 // A CGLayer that stores the contents of the backing store, cached in GPU | 64 // A CGLayer that stores the contents of the backing store, cached in GPU |
65 // memory if possible. | 65 // memory if possible. |
66 CGLayerRef cg_layer() { return cg_layer_; } | 66 CGLayerRef cg_layer() { return cg_layer_; } |
| 67 // A CGBitmapContext that stores the contents of the backing store if the |
| 68 // corresponding Cocoa view has not been inserted into an NSWindow yet. |
| 69 CGContextRef cg_bitmap() { return cg_bitmap_; } |
| 70 |
67 // Paint the layer into a graphics context--if the target is a window, | 71 // Paint the layer into a graphics context--if the target is a window, |
68 // this should be a GPU->GPU copy (and therefore very fast). | 72 // this should be a GPU->GPU copy (and therefore very fast). |
69 void PaintToRect(const gfx::Rect& dest_rect, CGContextRef target); | 73 void PaintToRect(const gfx::Rect& dest_rect, CGContextRef target); |
70 #elif defined(OS_LINUX) | 74 #elif defined(OS_LINUX) |
71 Display* display() const { return display_; } | 75 Display* display() const { return display_; } |
72 XID root_window() const { return root_window_; }; | 76 XID root_window() const { return root_window_; }; |
73 | 77 |
74 // Copy from the server-side backing store to the target window | 78 // Copy from the server-side backing store to the target window |
75 // display: the display of the backing store and target window | 79 // display: the display of the backing store and target window |
76 // damage: the area to copy | 80 // damage: the area to copy |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 #if defined(OS_WIN) | 115 #if defined(OS_WIN) |
112 // The backing store dc. | 116 // The backing store dc. |
113 HDC hdc_; | 117 HDC hdc_; |
114 // Handle to the backing store dib. | 118 // Handle to the backing store dib. |
115 HANDLE backing_store_dib_; | 119 HANDLE backing_store_dib_; |
116 // Handle to the original bitmap in the dc. | 120 // Handle to the original bitmap in the dc. |
117 HANDLE original_bitmap_; | 121 HANDLE original_bitmap_; |
118 // Number of bits per pixel of the screen. | 122 // Number of bits per pixel of the screen. |
119 int color_depth_; | 123 int color_depth_; |
120 #elif defined(OS_MACOSX) | 124 #elif defined(OS_MACOSX) |
| 125 scoped_cftyperef<CGContextRef> cg_bitmap_; |
121 scoped_cftyperef<CGLayerRef> cg_layer_; | 126 scoped_cftyperef<CGLayerRef> cg_layer_; |
122 #elif defined(OS_LINUX) | 127 #elif defined(OS_LINUX) |
123 // Paints the bitmap from the renderer onto the backing store without | 128 // Paints the bitmap from the renderer onto the backing store without |
124 // using Xrender to composite the pixmaps. | 129 // using Xrender to composite the pixmaps. |
125 void PaintRectWithoutXrender(TransportDIB* bitmap, | 130 void PaintRectWithoutXrender(TransportDIB* bitmap, |
126 const gfx::Rect& bitmap_rect); | 131 const gfx::Rect& bitmap_rect); |
127 | 132 |
128 // This is the connection to the X server where this backing store will be | 133 // This is the connection to the X server where this backing store will be |
129 // displayed. | 134 // displayed. |
130 Display* const display_; | 135 Display* const display_; |
(...skipping 14 matching lines...) Expand all Loading... |
145 // This is the RENDER picture pointing at |pixmap_|. | 150 // This is the RENDER picture pointing at |pixmap_|. |
146 XID picture_; | 151 XID picture_; |
147 // This is a default graphic context, used in XCopyArea | 152 // This is a default graphic context, used in XCopyArea |
148 void* pixmap_gc_; | 153 void* pixmap_gc_; |
149 #endif | 154 #endif |
150 | 155 |
151 DISALLOW_COPY_AND_ASSIGN(BackingStore); | 156 DISALLOW_COPY_AND_ASSIGN(BackingStore); |
152 }; | 157 }; |
153 | 158 |
154 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_ | 159 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_H_ |
OLD | NEW |