OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/layers/texture_layer.h" | 5 #include "cc/layers/texture_layer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 namespace cc { | 51 namespace cc { |
52 namespace { | 52 namespace { |
53 | 53 |
54 gpu::Mailbox MailboxFromChar(char value) { | 54 gpu::Mailbox MailboxFromChar(char value) { |
55 gpu::Mailbox mailbox; | 55 gpu::Mailbox mailbox; |
56 memset(mailbox.name, value, sizeof(mailbox.name)); | 56 memset(mailbox.name, value, sizeof(mailbox.name)); |
57 return mailbox; | 57 return mailbox; |
58 } | 58 } |
59 | 59 |
60 gpu::SyncToken SyncTokenFromUInt(uint32_t value) { | 60 gpu::SyncToken SyncTokenFromUInt(uint32_t value) { |
61 return gpu::SyncToken(gpu::CommandBufferNamespace::GPU_IO, 0, 0x123, value); | 61 return gpu::SyncToken(gpu::CommandBufferNamespace::GPU_IO, 0, |
| 62 gpu::CommandBufferId::FromUnsafeValue(0x123), value); |
62 } | 63 } |
63 | 64 |
64 class MockLayerTreeHost : public LayerTreeHost { | 65 class MockLayerTreeHost : public LayerTreeHost { |
65 public: | 66 public: |
66 static scoped_ptr<MockLayerTreeHost> Create( | 67 static scoped_ptr<MockLayerTreeHost> Create( |
67 FakeLayerTreeHostClient* client, | 68 FakeLayerTreeHostClient* client, |
68 TaskGraphRunner* task_graph_runner) { | 69 TaskGraphRunner* task_graph_runner) { |
69 LayerTreeHost::InitParams params; | 70 LayerTreeHost::InitParams params; |
70 params.client = client; | 71 params.client = client; |
71 params.task_graph_runner = task_graph_runner; | 72 params.task_graph_runner = task_graph_runner; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 void(SharedBitmap* shared_bitmap, | 139 void(SharedBitmap* shared_bitmap, |
139 const gpu::SyncToken& sync_token, | 140 const gpu::SyncToken& sync_token, |
140 bool lost_resource, | 141 bool lost_resource, |
141 BlockingTaskRunner* main_thread_task_runner)); | 142 BlockingTaskRunner* main_thread_task_runner)); |
142 }; | 143 }; |
143 | 144 |
144 struct CommonMailboxObjects { | 145 struct CommonMailboxObjects { |
145 explicit CommonMailboxObjects(SharedBitmapManager* manager) | 146 explicit CommonMailboxObjects(SharedBitmapManager* manager) |
146 : mailbox_name1_(MailboxFromChar('1')), | 147 : mailbox_name1_(MailboxFromChar('1')), |
147 mailbox_name2_(MailboxFromChar('2')), | 148 mailbox_name2_(MailboxFromChar('2')), |
148 sync_token1_(gpu::CommandBufferNamespace::GPU_IO, 123, 0x234, 1), | 149 sync_token1_(gpu::CommandBufferNamespace::GPU_IO, |
149 sync_token2_(gpu::CommandBufferNamespace::GPU_IO, 123, 0x234, 2) { | 150 123, |
| 151 gpu::CommandBufferId::FromUnsafeValue(0x234), |
| 152 1), |
| 153 sync_token2_(gpu::CommandBufferNamespace::GPU_IO, |
| 154 123, |
| 155 gpu::CommandBufferId::FromUnsafeValue(0x234), |
| 156 2) { |
150 release_mailbox1_ = base::Bind(&MockMailboxCallback::Release, | 157 release_mailbox1_ = base::Bind(&MockMailboxCallback::Release, |
151 base::Unretained(&mock_callback_), | 158 base::Unretained(&mock_callback_), |
152 mailbox_name1_); | 159 mailbox_name1_); |
153 release_mailbox2_ = base::Bind(&MockMailboxCallback::Release, | 160 release_mailbox2_ = base::Bind(&MockMailboxCallback::Release, |
154 base::Unretained(&mock_callback_), | 161 base::Unretained(&mock_callback_), |
155 mailbox_name2_); | 162 mailbox_name2_); |
156 release_mailbox1_impl_ = base::Bind(&MockMailboxCallback::ReleaseImpl, | 163 release_mailbox1_impl_ = base::Bind(&MockMailboxCallback::ReleaseImpl, |
157 base::Unretained(&mock_callback_), | 164 base::Unretained(&mock_callback_), |
158 mailbox_name1_); | 165 mailbox_name1_); |
159 release_mailbox2_impl_ = base::Bind(&MockMailboxCallback::ReleaseImpl, | 166 release_mailbox2_impl_ = base::Bind(&MockMailboxCallback::ReleaseImpl, |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 int callback_count_; | 1494 int callback_count_; |
1488 scoped_refptr<Layer> root_; | 1495 scoped_refptr<Layer> root_; |
1489 scoped_refptr<TextureLayer> layer_; | 1496 scoped_refptr<TextureLayer> layer_; |
1490 }; | 1497 }; |
1491 | 1498 |
1492 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 1499 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
1493 TextureLayerWithMailboxImplThreadDeleted); | 1500 TextureLayerWithMailboxImplThreadDeleted); |
1494 | 1501 |
1495 } // namespace | 1502 } // namespace |
1496 } // namespace cc | 1503 } // namespace cc |
OLD | NEW |