| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/renderer/pepper/ppb_graphics_3d_impl.h" | 5 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 PP_Bool PPB_Graphics3D_Impl::Flush(int32_t put_offset) { | 112 PP_Bool PPB_Graphics3D_Impl::Flush(int32_t put_offset) { |
| 113 GetCommandBuffer()->Flush(put_offset); | 113 GetCommandBuffer()->Flush(put_offset); |
| 114 return PP_TRUE; | 114 return PP_TRUE; |
| 115 } | 115 } |
| 116 | 116 |
| 117 gpu::CommandBuffer::State PPB_Graphics3D_Impl::WaitForTokenInRange( | 117 gpu::CommandBuffer::State PPB_Graphics3D_Impl::WaitForTokenInRange( |
| 118 int32_t start, | 118 int32_t start, |
| 119 int32_t end) { | 119 int32_t end) { |
| 120 GetCommandBuffer()->WaitForTokenInRange(start, end); | 120 return GetCommandBuffer()->WaitForTokenInRange(start, end); |
| 121 return GetCommandBuffer()->GetLastState(); | |
| 122 } | 121 } |
| 123 | 122 |
| 124 gpu::CommandBuffer::State PPB_Graphics3D_Impl::WaitForGetOffsetInRange( | 123 gpu::CommandBuffer::State PPB_Graphics3D_Impl::WaitForGetOffsetInRange( |
| 125 int32_t start, | 124 int32_t start, |
| 126 int32_t end) { | 125 int32_t end) { |
| 127 GetCommandBuffer()->WaitForGetOffsetInRange(start, end); | 126 return GetCommandBuffer()->WaitForGetOffsetInRange(start, end); |
| 128 return GetCommandBuffer()->GetLastState(); | |
| 129 } | 127 } |
| 130 | 128 |
| 131 void PPB_Graphics3D_Impl::EnsureWorkVisible() { | 129 void PPB_Graphics3D_Impl::EnsureWorkVisible() { |
| 132 command_buffer_->EnsureWorkVisible(); | 130 command_buffer_->EnsureWorkVisible(); |
| 133 } | 131 } |
| 134 | 132 |
| 135 void PPB_Graphics3D_Impl::TakeFrontBuffer() { | 133 void PPB_Graphics3D_Impl::TakeFrontBuffer() { |
| 136 if (!taken_front_buffer_.IsZero()) { | 134 if (!taken_front_buffer_.IsZero()) { |
| 137 DLOG(ERROR) | 135 DLOG(ERROR) |
| 138 << "TakeFrontBuffer should only be called once before DoSwapBuffers"; | 136 << "TakeFrontBuffer should only be called once before DoSwapBuffers"; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 if (!mailboxes_to_reuse_.empty()) { | 356 if (!mailboxes_to_reuse_.empty()) { |
| 359 gpu::Mailbox mailbox = mailboxes_to_reuse_.back(); | 357 gpu::Mailbox mailbox = mailboxes_to_reuse_.back(); |
| 360 mailboxes_to_reuse_.pop_back(); | 358 mailboxes_to_reuse_.pop_back(); |
| 361 return mailbox; | 359 return mailbox; |
| 362 } | 360 } |
| 363 | 361 |
| 364 return gpu::Mailbox::Generate(); | 362 return gpu::Mailbox::Generate(); |
| 365 } | 363 } |
| 366 | 364 |
| 367 } // namespace content | 365 } // namespace content |
| OLD | NEW |