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/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } else if (old_mailbox.IsSharedMemory()) { | 175 } else if (old_mailbox.IsSharedMemory()) { |
176 base::SharedMemory* old_buffer = old_mailbox.shared_memory(); | 176 base::SharedMemory* old_buffer = old_mailbox.shared_memory(); |
177 const size_t size = old_mailbox.shared_memory_size_in_bytes(); | 177 const size_t size = old_mailbox.shared_memory_size_in_bytes(); |
178 | 178 |
179 scoped_ptr<base::SharedMemory> new_buffer(new base::SharedMemory); | 179 scoped_ptr<base::SharedMemory> new_buffer(new base::SharedMemory); |
180 new_buffer->CreateAndMapAnonymous(size); | 180 new_buffer->CreateAndMapAnonymous(size); |
181 | 181 |
182 if (old_buffer->memory() && new_buffer->memory()) { | 182 if (old_buffer->memory() && new_buffer->memory()) { |
183 memcpy(new_buffer->memory(), old_buffer->memory(), size); | 183 memcpy(new_buffer->memory(), old_buffer->memory(), size); |
184 base::SharedMemory* new_buffer_raw_ptr = new_buffer.get(); | 184 base::SharedMemory* new_buffer_raw_ptr = new_buffer.get(); |
185 cc::TextureMailbox::ReleaseCallback callback = | 185 scoped_ptr<cc::ScopedReleaseCallback> callback = |
186 base::Bind(MailboxReleaseCallback, Passed(&new_buffer)); | 186 cc::ScopedReleaseCallback::Create(base::Bind(MailboxReleaseCallback, |
| 187 Passed(&new_buffer))); |
187 cc::TextureMailbox new_mailbox(new_buffer_raw_ptr, | 188 cc::TextureMailbox new_mailbox(new_buffer_raw_ptr, |
188 old_mailbox.shared_memory_size(), | 189 old_mailbox.shared_memory_size()); |
189 callback); | 190 layer_->SetTextureMailbox(new_mailbox, |
190 layer_->SetTextureMailbox(new_mailbox, mailbox_scale_factor); | 191 callback.Pass(), |
| 192 mailbox_scale_factor); |
191 } | 193 } |
192 } | 194 } |
193 | 195 |
194 UpdateLayerName(name_); | 196 UpdateLayerName(name_); |
195 layer_->SetFillsBoundsOpaquely(!transparent_); | 197 layer_->SetFillsBoundsOpaquely(!transparent_); |
196 // Install new layer as a sibling of the old layer, stacked below it. | 198 // Install new layer as a sibling of the old layer, stacked below it. |
197 if (old_layer->parent()) { | 199 if (old_layer->parent()) { |
198 old_layer->parent()->Add(layer_); | 200 old_layer->parent()->Add(layer_); |
199 old_layer->parent()->StackBelow(layer_, old_layer); | 201 old_layer->parent()->StackBelow(layer_, old_layer); |
200 } | 202 } |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 bool contains_mouse = false; | 1130 bool contains_mouse = false; |
1129 if (IsVisible()) { | 1131 if (IsVisible()) { |
1130 RootWindow* root_window = GetRootWindow(); | 1132 RootWindow* root_window = GetRootWindow(); |
1131 contains_mouse = root_window && | 1133 contains_mouse = root_window && |
1132 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); | 1134 ContainsPointInRoot(root_window->GetLastMouseLocationInRoot()); |
1133 } | 1135 } |
1134 return contains_mouse; | 1136 return contains_mouse; |
1135 } | 1137 } |
1136 | 1138 |
1137 } // namespace aura | 1139 } // namespace aura |
OLD | NEW |