| 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 APP_SURFACE_TRANSPORT_DIB_H_ | 5 #ifndef APP_SURFACE_TRANSPORT_DIB_H_ |
| 6 #define APP_SURFACE_TRANSPORT_DIB_H_ | 6 #define APP_SURFACE_TRANSPORT_DIB_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) || defined(OS_MACOSX) | 10 #if defined(OS_WIN) || defined(OS_MACOSX) |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // | 115 // |
| 116 // The size is the minimum size in bytes of the memory backing the transport | 116 // The size is the minimum size in bytes of the memory backing the transport |
| 117 // DIB (we may actually allocate more than that to give us better reuse when | 117 // DIB (we may actually allocate more than that to give us better reuse when |
| 118 // cached). | 118 // cached). |
| 119 // | 119 // |
| 120 // The sequence number is used to uniquely identify the transport DIB. It | 120 // The sequence number is used to uniquely identify the transport DIB. It |
| 121 // should be unique for all transport DIBs ever created in the same | 121 // should be unique for all transport DIBs ever created in the same |
| 122 // renderer. | 122 // renderer. |
| 123 static TransportDIB* Create(size_t size, uint32 sequence_num); | 123 static TransportDIB* Create(size_t size, uint32 sequence_num); |
| 124 | 124 |
| 125 // Map the referenced transport DIB. Returns NULL on failure. | 125 // Map the referenced transport DIB. The caller owns the returned object. |
| 126 // Returns NULL on failure. |
| 126 static TransportDIB* Map(Handle transport_dib); | 127 static TransportDIB* Map(Handle transport_dib); |
| 127 | 128 |
| 128 // Returns true if the handle is valid. | 129 // Returns true if the handle is valid. |
| 129 static bool is_valid(Handle dib); | 130 static bool is_valid(Handle dib); |
| 130 | 131 |
| 131 // Returns a canvas using the memory of this TransportDIB. The returned | 132 // Returns a canvas using the memory of this TransportDIB. The returned |
| 132 // pointer will be owned by the caller. The bitmap will be of the given size, | 133 // pointer will be owned by the caller. The bitmap will be of the given size, |
| 133 // which should fit inside this memory. | 134 // which should fit inside this memory. |
| 134 // | 135 // |
| 135 // Will return NULL on allocation failure. This could be because the image | 136 // Will return NULL on allocation failure. This could be because the image |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 Display* display_; // connection to the X server | 172 Display* display_; // connection to the X server |
| 172 #endif | 173 #endif |
| 173 size_t size_; // length, in bytes | 174 size_t size_; // length, in bytes |
| 174 | 175 |
| 175 DISALLOW_COPY_AND_ASSIGN(TransportDIB); | 176 DISALLOW_COPY_AND_ASSIGN(TransportDIB); |
| 176 }; | 177 }; |
| 177 | 178 |
| 178 class MessageLoop; | 179 class MessageLoop; |
| 179 | 180 |
| 180 #endif // APP_SURFACE_TRANSPORT_DIB_H_ | 181 #endif // APP_SURFACE_TRANSPORT_DIB_H_ |
| OLD | NEW |