| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "cc/layers/texture_layer.h" | 5 #include "cc/layers/texture_layer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| 11 #include "base/trace_event/trace_event.h" |
| 11 #include "cc/base/simple_enclosed_region.h" | 12 #include "cc/base/simple_enclosed_region.h" |
| 12 #include "cc/layers/texture_layer_client.h" | 13 #include "cc/layers/texture_layer_client.h" |
| 13 #include "cc/layers/texture_layer_impl.h" | 14 #include "cc/layers/texture_layer_impl.h" |
| 14 #include "cc/resources/single_release_callback.h" | 15 #include "cc/resources/single_release_callback.h" |
| 15 #include "cc/resources/single_release_callback_impl.h" | 16 #include "cc/resources/single_release_callback_impl.h" |
| 16 #include "cc/trees/blocking_task_runner.h" | 17 #include "cc/trees/blocking_task_runner.h" |
| 17 #include "cc/trees/layer_tree_host.h" | 18 #include "cc/trees/layer_tree_host.h" |
| 18 | 19 |
| 19 namespace cc { | 20 namespace cc { |
| 20 | 21 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 220 } |
| 220 | 221 |
| 221 // SetTextureMailbox could be called externally and the same mailbox used for | 222 // SetTextureMailbox could be called externally and the same mailbox used for |
| 222 // different textures. Such callers notify this layer that the texture has | 223 // different textures. Such callers notify this layer that the texture has |
| 223 // changed by calling SetNeedsDisplay, so check for that here. | 224 // changed by calling SetNeedsDisplay, so check for that here. |
| 224 return updated || !update_rect_.IsEmpty(); | 225 return updated || !update_rect_.IsEmpty(); |
| 225 } | 226 } |
| 226 | 227 |
| 227 void TextureLayer::PushPropertiesTo(LayerImpl* layer) { | 228 void TextureLayer::PushPropertiesTo(LayerImpl* layer) { |
| 228 Layer::PushPropertiesTo(layer); | 229 Layer::PushPropertiesTo(layer); |
| 230 TRACE_EVENT0("cc", "TextureLayer::PushPropertiesTo"); |
| 229 | 231 |
| 230 TextureLayerImpl* texture_layer = static_cast<TextureLayerImpl*>(layer); | 232 TextureLayerImpl* texture_layer = static_cast<TextureLayerImpl*>(layer); |
| 231 texture_layer->SetFlipped(flipped_); | 233 texture_layer->SetFlipped(flipped_); |
| 232 texture_layer->SetNearestNeighbor(nearest_neighbor_); | 234 texture_layer->SetNearestNeighbor(nearest_neighbor_); |
| 233 texture_layer->SetUVTopLeft(uv_top_left_); | 235 texture_layer->SetUVTopLeft(uv_top_left_); |
| 234 texture_layer->SetUVBottomRight(uv_bottom_right_); | 236 texture_layer->SetUVBottomRight(uv_bottom_right_); |
| 235 texture_layer->SetVertexOpacity(vertex_opacity_); | 237 texture_layer->SetVertexOpacity(vertex_opacity_); |
| 236 texture_layer->SetPremultipliedAlpha(premultiplied_alpha_); | 238 texture_layer->SetPremultipliedAlpha(premultiplied_alpha_); |
| 237 texture_layer->SetBlendBackgroundColor(blend_background_color_); | 239 texture_layer->SetBlendBackgroundColor(blend_background_color_); |
| 238 if (needs_set_mailbox_) { | 240 if (needs_set_mailbox_) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( | 317 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( |
| 316 const gpu::SyncToken& sync_token, | 318 const gpu::SyncToken& sync_token, |
| 317 bool is_lost, | 319 bool is_lost, |
| 318 BlockingTaskRunner* main_thread_task_runner) { | 320 BlockingTaskRunner* main_thread_task_runner) { |
| 319 Return(sync_token, is_lost); | 321 Return(sync_token, is_lost); |
| 320 main_thread_task_runner->PostTask( | 322 main_thread_task_runner->PostTask( |
| 321 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); | 323 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); |
| 322 } | 324 } |
| 323 | 325 |
| 324 } // namespace cc | 326 } // namespace cc |
| OLD | NEW |