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 "cc/base/simple_enclosed_region.h" | 11 #include "cc/base/simple_enclosed_region.h" |
12 #include "cc/layers/texture_layer_client.h" | 12 #include "cc/layers/texture_layer_client.h" |
13 #include "cc/layers/texture_layer_impl.h" | 13 #include "cc/layers/texture_layer_impl.h" |
14 #include "cc/resources/single_release_callback.h" | 14 #include "cc/resources/single_release_callback.h" |
15 #include "cc/resources/single_release_callback_impl.h" | 15 #include "cc/resources/single_release_callback_impl.h" |
16 #include "cc/trees/blocking_task_runner.h" | 16 #include "cc/trees/blocking_task_runner.h" |
17 #include "cc/trees/layer_tree_host.h" | 17 #include "cc/trees/layer_tree_host.h" |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 | 20 |
21 scoped_refptr<TextureLayer> TextureLayer::CreateForMailbox( | 21 scoped_refptr<TextureLayer> TextureLayer::CreateForMailbox( |
| 22 const LayerSettings& settings, |
22 TextureLayerClient* client) { | 23 TextureLayerClient* client) { |
23 return scoped_refptr<TextureLayer>(new TextureLayer(client)); | 24 return scoped_refptr<TextureLayer>(new TextureLayer(settings, client)); |
24 } | 25 } |
25 | 26 |
26 TextureLayer::TextureLayer(TextureLayerClient* client) | 27 TextureLayer::TextureLayer(const LayerSettings& settings, |
27 : Layer(), | 28 TextureLayerClient* client) |
| 29 : Layer(settings), |
28 client_(client), | 30 client_(client), |
29 flipped_(true), | 31 flipped_(true), |
30 nearest_neighbor_(false), | 32 nearest_neighbor_(false), |
31 uv_top_left_(0.f, 0.f), | 33 uv_top_left_(0.f, 0.f), |
32 uv_bottom_right_(1.f, 1.f), | 34 uv_bottom_right_(1.f, 1.f), |
33 premultiplied_alpha_(true), | 35 premultiplied_alpha_(true), |
34 blend_background_color_(false), | 36 blend_background_color_(false), |
35 rate_limit_context_(false), | 37 rate_limit_context_(false), |
36 needs_set_mailbox_(false) { | 38 needs_set_mailbox_(false) { |
37 vertex_opacity_[0] = 1.0f; | 39 vertex_opacity_[0] = 1.0f; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( | 344 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( |
343 uint32 sync_point, | 345 uint32 sync_point, |
344 bool is_lost, | 346 bool is_lost, |
345 BlockingTaskRunner* main_thread_task_runner) { | 347 BlockingTaskRunner* main_thread_task_runner) { |
346 Return(sync_point, is_lost); | 348 Return(sync_point, is_lost); |
347 main_thread_task_runner->PostTask( | 349 main_thread_task_runner->PostTask( |
348 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); | 350 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); |
349 } | 351 } |
350 | 352 |
351 } // namespace cc | 353 } // namespace cc |
OLD | NEW |