OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/test/test_simple_task_runner.h" | 8 #include "base/test/test_simple_task_runner.h" |
9 #include "gpu/command_buffer/client/gles2_interface_stub.h" | 9 #include "gpu/command_buffer/client/gles2_interface_stub.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 void OrderingBarrierCHROMIUM() override { | 30 void OrderingBarrierCHROMIUM() override { |
31 flushed_fence_sync_ = next_fence_sync_ - 1; | 31 flushed_fence_sync_ = next_fence_sync_ - 1; |
32 } | 32 } |
33 | 33 |
34 GLuint64 InsertFenceSyncCHROMIUM() override { return next_fence_sync_++; } | 34 GLuint64 InsertFenceSyncCHROMIUM() override { return next_fence_sync_++; } |
35 | 35 |
36 void GenSyncTokenCHROMIUM(GLuint64 fence_sync, GLbyte* sync_token) override { | 36 void GenSyncTokenCHROMIUM(GLuint64 fence_sync, GLbyte* sync_token) override { |
37 gpu::SyncToken sync_token_data; | 37 gpu::SyncToken sync_token_data; |
38 if (fence_sync <= flushed_fence_sync_) { | 38 if (fence_sync <= flushed_fence_sync_) { |
39 sync_token_data.Set(gpu::CommandBufferNamespace::GPU_IO, 0, 0, | 39 sync_token_data.Set(gpu::CommandBufferNamespace::GPU_IO, 0, |
40 fence_sync); | 40 gpu::CommandBufferId(), fence_sync); |
41 sync_token_data.SetVerifyFlush(); | 41 sync_token_data.SetVerifyFlush(); |
42 } | 42 } |
43 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); | 43 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); |
44 } | 44 } |
45 | 45 |
46 void GenUnverifiedSyncTokenCHROMIUM(GLuint64 fence_sync, | 46 void GenUnverifiedSyncTokenCHROMIUM(GLuint64 fence_sync, |
47 GLbyte* sync_token) override { | 47 GLbyte* sync_token) override { |
48 gpu::SyncToken sync_token_data; | 48 gpu::SyncToken sync_token_data; |
49 if (fence_sync <= flushed_fence_sync_) { | 49 if (fence_sync <= flushed_fence_sync_) { |
50 sync_token_data.Set(gpu::CommandBufferNamespace::GPU_IO, 0, 0, | 50 sync_token_data.Set(gpu::CommandBufferNamespace::GPU_IO, 0, |
51 fence_sync); | 51 gpu::CommandBufferId(), fence_sync); |
52 } | 52 } |
53 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); | 53 memcpy(sync_token, &sync_token_data, sizeof(sync_token_data)); |
54 } | 54 } |
55 | 55 |
56 void GenMailboxCHROMIUM(GLbyte* mailbox) override { | 56 void GenMailboxCHROMIUM(GLbyte* mailbox) override { |
57 *reinterpret_cast<unsigned*>(mailbox) = ++mailbox_; | 57 *reinterpret_cast<unsigned*>(mailbox) = ++mailbox_; |
58 } | 58 } |
59 | 59 |
60 private: | 60 private: |
61 uint64_t next_fence_sync_ = 1u; | 61 uint64_t next_fence_sync_ = 1u; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 gpu_memory_buffer_pool_->MaybeCreateHardwareFrame( | 293 gpu_memory_buffer_pool_->MaybeCreateHardwareFrame( |
294 software_frame, base::Bind(MaybeCreateHardwareFrameCallback, &frame)); | 294 software_frame, base::Bind(MaybeCreateHardwareFrameCallback, &frame)); |
295 | 295 |
296 RunUntilIdle(); | 296 RunUntilIdle(); |
297 | 297 |
298 EXPECT_NE(software_frame.get(), frame.get()); | 298 EXPECT_NE(software_frame.get(), frame.get()); |
299 EXPECT_EQ(3u, gles2_->gen_textures); | 299 EXPECT_EQ(3u, gles2_->gen_textures); |
300 } | 300 } |
301 | 301 |
302 } // namespace media | 302 } // namespace media |
OLD | NEW |