| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file contains unit tests for gles2 commmands | 5 // This file contains unit tests for gles2 commmands |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 buffer_tokens[buffer] = async_token; | 98 buffer_tokens[buffer] = async_token; |
| 99 | 99 |
| 100 // Set the async upload token on the fake upload thread and assert that | 100 // Set the async upload token on the fake upload thread and assert that |
| 101 // the associated buffer still has the given token. | 101 // the associated buffer still has the given token. |
| 102 thread.task_runner()->PostTask( | 102 thread.task_runner()->PostTask( |
| 103 FROM_HERE, base::Bind(&SignalCompletion, &buffer_tokens[buffer], | 103 FROM_HERE, base::Bind(&SignalCompletion, &buffer_tokens[buffer], |
| 104 async_token, &sync)); | 104 async_token, &sync)); |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Flush the thread message loop before starting again. | 107 // Flush the thread message loop before starting again. |
| 108 base::WaitableEvent waitable(false, false); | 108 base::WaitableEvent waitable( |
| 109 base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 110 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 109 thread.task_runner()->PostTask( | 111 thread.task_runner()->PostTask( |
| 110 FROM_HERE, | 112 FROM_HERE, |
| 111 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waitable))); | 113 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waitable))); |
| 112 waitable.Wait(); | 114 waitable.Wait(); |
| 113 } | 115 } |
| 114 } | 116 } |
| 115 | 117 |
| 116 // GCC requires these declarations, but MSVC requires they not be present | 118 // GCC requires these declarations, but MSVC requires they not be present |
| 117 #ifndef _MSC_VER | 119 #ifndef _MSC_VER |
| 118 const unsigned char GLES2FormatTest::kInitialValue; | 120 const unsigned char GLES2FormatTest::kInitialValue; |
| 119 #endif | 121 #endif |
| 120 | 122 |
| 121 #include "gpu/command_buffer/common/gles2_cmd_format_test_autogen.h" | 123 #include "gpu/command_buffer/common/gles2_cmd_format_test_autogen.h" |
| 122 | 124 |
| 123 } // namespace gles2 | 125 } // namespace gles2 |
| 124 } // namespace gpu | 126 } // namespace gpu |
| 125 | 127 |
| OLD | NEW |