| 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 "base/trace_event/trace_event.h" |
| 12 #include "cc/base/simple_enclosed_region.h" | 12 #include "cc/base/simple_enclosed_region.h" |
| 13 #include "cc/layers/texture_layer_client.h" | 13 #include "cc/layers/texture_layer_client.h" |
| 14 #include "cc/layers/texture_layer_impl.h" | 14 #include "cc/layers/texture_layer_impl.h" |
| 15 #include "cc/resources/single_release_callback.h" | 15 #include "cc/resources/single_release_callback.h" |
| 16 #include "cc/resources/single_release_callback_impl.h" | 16 #include "cc/resources/single_release_callback_impl.h" |
| 17 #include "cc/trees/blocking_task_runner.h" | 17 #include "cc/trees/blocking_task_runner.h" |
| 18 #include "cc/trees/layer_tree_host.h" | 18 #include "cc/trees/layer_tree_host.h" |
| 19 | 19 |
| 20 namespace cc { | 20 namespace cc { |
| 21 | 21 |
| 22 scoped_refptr<TextureLayer> TextureLayer::CreateForMailbox( | 22 scoped_refptr<TextureLayer> TextureLayer::CreateForMailbox( |
| 23 const LayerSettings& settings, | |
| 24 TextureLayerClient* client) { | 23 TextureLayerClient* client) { |
| 25 return scoped_refptr<TextureLayer>(new TextureLayer(settings, client)); | 24 return scoped_refptr<TextureLayer>(new TextureLayer(client)); |
| 26 } | 25 } |
| 27 | 26 |
| 28 TextureLayer::TextureLayer(const LayerSettings& settings, | 27 TextureLayer::TextureLayer(TextureLayerClient* client) |
| 29 TextureLayerClient* client) | 28 : client_(client), |
| 30 : Layer(settings), | |
| 31 client_(client), | |
| 32 flipped_(true), | 29 flipped_(true), |
| 33 nearest_neighbor_(false), | 30 nearest_neighbor_(false), |
| 34 uv_top_left_(0.f, 0.f), | 31 uv_top_left_(0.f, 0.f), |
| 35 uv_bottom_right_(1.f, 1.f), | 32 uv_bottom_right_(1.f, 1.f), |
| 36 premultiplied_alpha_(true), | 33 premultiplied_alpha_(true), |
| 37 blend_background_color_(false), | 34 blend_background_color_(false), |
| 38 needs_set_mailbox_(false) { | 35 needs_set_mailbox_(false) { |
| 39 vertex_opacity_[0] = 1.0f; | 36 vertex_opacity_[0] = 1.0f; |
| 40 vertex_opacity_[1] = 1.0f; | 37 vertex_opacity_[1] = 1.0f; |
| 41 vertex_opacity_[2] = 1.0f; | 38 vertex_opacity_[2] = 1.0f; |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( | 314 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( |
| 318 const gpu::SyncToken& sync_token, | 315 const gpu::SyncToken& sync_token, |
| 319 bool is_lost, | 316 bool is_lost, |
| 320 BlockingTaskRunner* main_thread_task_runner) { | 317 BlockingTaskRunner* main_thread_task_runner) { |
| 321 Return(sync_token, is_lost); | 318 Return(sync_token, is_lost); |
| 322 main_thread_task_runner->PostTask( | 319 main_thread_task_runner->PostTask( |
| 323 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); | 320 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); |
| 324 } | 321 } |
| 325 | 322 |
| 326 } // namespace cc | 323 } // namespace cc |
| OLD | NEW |