OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "gpu/pgl/command_buffer_pepper.h" | 5 #include "gpu/pgl/command_buffer_pepper.h" |
6 | 6 |
7 #include "gpu/command_buffer/common/logging.h" | 7 #include "gpu/command_buffer/common/logging.h" |
8 | 8 |
9 using base::SharedMemory; | 9 using base::SharedMemory; |
10 using gpu::Buffer; | 10 using gpu::Buffer; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 | 76 |
77 if (NPERR_NO_ERROR != device_->flushContext(npp_, context_, NULL, NULL)) | 77 if (NPERR_NO_ERROR != device_->flushContext(npp_, context_, NULL, NULL)) |
78 context_->error = NPDeviceContext3DError_GenericError; | 78 context_->error = NPDeviceContext3DError_GenericError; |
79 | 79 |
80 context_->waitForProgress = true; | 80 context_->waitForProgress = true; |
81 | 81 |
82 return ConvertState(); | 82 return ConvertState(); |
83 #endif // ENABLE_NEW_NPDEVICE_API | 83 #endif // ENABLE_NEW_NPDEVICE_API |
84 } | 84 } |
85 | 85 |
86 CommandBuffer::State CommandBufferPepper::Flush(int32 put_offset) { | 86 void CommandBufferPepper::Flush(int32 put_offset) { |
apatrick
2011/01/14 18:31:34
I think we might want to change PPAPI to make the
Antoine Labour
2011/01/14 21:35:33
This is old Pepper v1 code. It will go away in a f
| |
87 FlushSync(put_offset); | |
88 } | |
89 | |
90 CommandBuffer::State CommandBufferPepper::FlushSync(int32 put_offset) { | |
87 #if defined(ENABLE_NEW_NPDEVICE_API) | 91 #if defined(ENABLE_NEW_NPDEVICE_API) |
88 int32 input_attribs[] = { | 92 int32 input_attribs[] = { |
89 NP3DAttrib_PutOffset, put_offset, | 93 NP3DAttrib_PutOffset, put_offset, |
90 NPAttrib_End | 94 NPAttrib_End |
91 }; | 95 }; |
92 int32 output_attribs[] = { | 96 int32 output_attribs[] = { |
93 NP3DAttrib_CommandBufferSize, 0, | 97 NP3DAttrib_CommandBufferSize, 0, |
94 NP3DAttrib_GetOffset, 0, | 98 NP3DAttrib_GetOffset, 0, |
95 NP3DAttrib_PutOffset, 0, | 99 NP3DAttrib_PutOffset, 0, |
96 NP3DAttrib_Token, 0, | 100 NP3DAttrib_Token, 0, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 CommandBuffer::State CommandBufferPepper::ConvertState() { | 186 CommandBuffer::State CommandBufferPepper::ConvertState() { |
183 CommandBuffer::State state; | 187 CommandBuffer::State state; |
184 state.num_entries = context_->commandBufferSize; | 188 state.num_entries = context_->commandBufferSize; |
185 state.get_offset = context_->getOffset; | 189 state.get_offset = context_->getOffset; |
186 state.put_offset = context_->putOffset; | 190 state.put_offset = context_->putOffset; |
187 state.token = context_->token; | 191 state.token = context_->token; |
188 state.error = static_cast<gpu::error::Error>( | 192 state.error = static_cast<gpu::error::Error>( |
189 context_->error); | 193 context_->error); |
190 return state; | 194 return state; |
191 } | 195 } |
OLD | NEW |