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 #include "ui/surface/transport_dib.h" | 5 #include "ui/surface/transport_dib.h" |
6 | 6 |
7 // Desktop GTK Linux builds use the old-style SYSV SHM based DIBs. | 7 // Desktop GTK Linux builds use the old-style SYSV SHM based DIBs. |
8 | 8 |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 TransportDIB::Id TransportDIB::id() const { | 128 TransportDIB::Id TransportDIB::id() const { |
129 return key_; | 129 return key_; |
130 } | 130 } |
131 | 131 |
132 TransportDIB::Handle TransportDIB::handle() const { | 132 TransportDIB::Handle TransportDIB::handle() const { |
133 return key_.shmkey; | 133 return key_.shmkey; |
134 } | 134 } |
135 | 135 |
136 XID TransportDIB::MapToX(Display* display) { | 136 XID TransportDIB::MapToX(XDisplay* display) { |
137 if (!x_shm_) { | 137 if (!x_shm_) { |
138 x_shm_ = ui::AttachSharedMemory(display, key_.shmkey); | 138 x_shm_ = ui::AttachSharedMemory(display, key_.shmkey); |
139 display_ = display; | 139 display_ = display; |
140 } | 140 } |
141 | 141 |
142 return x_shm_; | 142 return x_shm_; |
143 } | 143 } |
144 | 144 |
145 void TransportDIB::DecreaseInFlightCounter() { | 145 void TransportDIB::DecreaseInFlightCounter() { |
146 CHECK(inflight_counter_); | 146 CHECK(inflight_counter_); |
147 inflight_counter_--; | 147 inflight_counter_--; |
148 if (!inflight_counter_ && detached_) | 148 if (!inflight_counter_ && detached_) |
149 delete this; | 149 delete this; |
150 } | 150 } |
151 | 151 |
152 void TransportDIB::Detach() { | 152 void TransportDIB::Detach() { |
153 CHECK(!detached_); | 153 CHECK(!detached_); |
154 detached_ = true; | 154 detached_ = true; |
155 if (!inflight_counter_) | 155 if (!inflight_counter_) |
156 delete this; | 156 delete this; |
157 } | 157 } |
158 | 158 |
OLD | NEW |