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 UI_SURFACE_TRANSPORT_DIB_H_ | 5 #ifndef UI_SURFACE_TRANSPORT_DIB_H_ |
6 #define UI_SURFACE_TRANSPORT_DIB_H_ | 6 #define UI_SURFACE_TRANSPORT_DIB_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/surface/surface_export.h" | 9 #include "ui/surface/surface_export.h" |
10 | 10 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // detached. | 198 // detached. |
199 void DecreaseInFlightCounter(); | 199 void DecreaseInFlightCounter(); |
200 | 200 |
201 // Deletes this transport DIB and detaches the shared memory once the | 201 // Deletes this transport DIB and detaches the shared memory once the |
202 // |inflight_counter_| is zero. | 202 // |inflight_counter_| is zero. |
203 void Detach(); | 203 void Detach(); |
204 #endif | 204 #endif |
205 | 205 |
206 private: | 206 private: |
207 TransportDIB(); | 207 TransportDIB(); |
| 208 |
| 209 // Verifies that the dib can hold a canvas of the requested dimensions. |
| 210 bool VerifyCanvasSize(int w, int h); |
| 211 |
208 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_ANDROID) | 212 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_ANDROID) |
209 explicit TransportDIB(base::SharedMemoryHandle dib); | 213 explicit TransportDIB(base::SharedMemoryHandle dib); |
210 base::SharedMemory shared_memory_; | 214 base::SharedMemory shared_memory_; |
211 uint32 sequence_num_; | 215 uint32 sequence_num_; |
212 #elif defined(USE_X11) | 216 #elif defined(USE_X11) |
213 Id key_; // SysV shared memory id | 217 Id key_; // SysV shared memory id |
214 void* address_; // mapped address | 218 void* address_; // mapped address |
215 XSharedMemoryId x_shm_; // X id for the shared segment | 219 XSharedMemoryId x_shm_; // X id for the shared segment |
216 Display* display_; // connection to the X server | 220 Display* display_; // connection to the X server |
217 size_t inflight_counter_; // How many requests to the X server are in flight | 221 size_t inflight_counter_; // How many requests to the X server are in flight |
218 bool detached_; // If true, delete the transport DIB when it is idle | 222 bool detached_; // If true, delete the transport DIB when it is idle |
219 #endif | 223 #endif |
220 size_t size_; // length, in bytes | 224 size_t size_; // length, in bytes |
221 | 225 |
222 DISALLOW_COPY_AND_ASSIGN(TransportDIB); | 226 DISALLOW_COPY_AND_ASSIGN(TransportDIB); |
223 }; | 227 }; |
224 | 228 |
225 #endif // UI_SURFACE_TRANSPORT_DIB_H_ | 229 #endif // UI_SURFACE_TRANSPORT_DIB_H_ |
OLD | NEW |