Chromium Code Reviews| 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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
| 10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
| (...skipping 3582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3593 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glProduceTextureCHROMIUM(" | 3593 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glProduceTextureCHROMIUM(" |
| 3594 << static_cast<const void*>(data) << ")"); | 3594 << static_cast<const void*>(data) << ")"); |
| 3595 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); | 3595 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); |
| 3596 DCHECK(mailbox.Verify()) << "ProduceTextureCHROMIUM was passed a " | 3596 DCHECK(mailbox.Verify()) << "ProduceTextureCHROMIUM was passed a " |
| 3597 "mailbox that was not generated by " | 3597 "mailbox that was not generated by " |
| 3598 "GenMailboxCHROMIUM."; | 3598 "GenMailboxCHROMIUM."; |
| 3599 helper_->ProduceTextureCHROMIUMImmediate(target, data); | 3599 helper_->ProduceTextureCHROMIUMImmediate(target, data); |
| 3600 CheckGLError(); | 3600 CheckGLError(); |
| 3601 } | 3601 } |
| 3602 | 3602 |
| 3603 void GLES2Implementation::ProduceTextureDirectCHROMIUM( | |
| 3604 GLuint texture, GLenum target, const GLbyte* data) { | |
| 3605 GPU_CLIENT_SINGLE_THREAD_CHECK(); | |
| 3606 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glProduceTextureDirectCHROMIUM(" | |
| 3607 << static_cast<const void*>(data) << ")"); | |
| 3608 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); | |
| 3609 DCHECK(mailbox.Verify()) << "ProduceTextureDirectCHROMIUM was passed a " | |
| 3610 "mailbox that was not generated by " | |
| 3611 "GenMailboxCHROMIUM."; | |
| 3612 helper_->ProduceTextureDirectCHROMIUMImmediate(texture, target, data); | |
| 3613 CheckGLError(); | |
| 3614 } | |
| 3615 | |
| 3603 void GLES2Implementation::ConsumeTextureCHROMIUM(GLenum target, | 3616 void GLES2Implementation::ConsumeTextureCHROMIUM(GLenum target, |
| 3604 const GLbyte* data) { | 3617 const GLbyte* data) { |
| 3605 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3618 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 3606 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glConsumeTextureCHROMIUM(" | 3619 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glConsumeTextureCHROMIUM(" |
| 3607 << static_cast<const void*>(data) << ")"); | 3620 << static_cast<const void*>(data) << ")"); |
| 3608 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); | 3621 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); |
| 3609 DCHECK(mailbox.Verify()) << "ConsumeTextureCHROMIUM was passed a " | 3622 DCHECK(mailbox.Verify()) << "ConsumeTextureCHROMIUM was passed a " |
| 3610 "mailbox that was not generated by " | 3623 "mailbox that was not generated by " |
| 3611 "GenMailboxCHROMIUM."; | 3624 "GenMailboxCHROMIUM."; |
| 3612 helper_->ConsumeTextureCHROMIUMImmediate(target, data); | 3625 helper_->ConsumeTextureCHROMIUMImmediate(target, data); |
| 3613 CheckGLError(); | 3626 CheckGLError(); |
| 3614 } | 3627 } |
| 3615 | 3628 |
| 3629 GLuint GLES2Implementation::CreateAndConsumeTextureCHROMIUM( | |
| 3630 GLenum target, const GLbyte* data) { | |
| 3631 GPU_CLIENT_SINGLE_THREAD_CHECK(); | |
| 3632 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateAndConsumeTextureCHROMIUM(" | |
| 3633 << static_cast<const void*>(data) << ")"); | |
| 3634 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); | |
| 3635 DCHECK(mailbox.Verify()) << "CreateAndConsumeTextureCHROMIUM was passed a " | |
| 3636 "mailbox that was not generated by " | |
| 3637 "GenMailboxCHROMIUM."; | |
| 3638 GLuint client_id; | |
| 3639 GetIdHandler(id_namespaces::kTextures)->MakeIds(this, 0, 1, &client_id); | |
| 3640 helper_->CreateAndConsumeTextureCHROMIUMImmediate(target, | |
| 3641 client_id, data); | |
|
vmiura
2014/06/03 00:00:50
I think we need the following Flush() here to ensu
| |
| 3642 CheckGLError(); | |
| 3643 return client_id; | |
| 3644 } | |
| 3645 | |
| 3616 void GLES2Implementation::PushGroupMarkerEXT( | 3646 void GLES2Implementation::PushGroupMarkerEXT( |
| 3617 GLsizei length, const GLchar* marker) { | 3647 GLsizei length, const GLchar* marker) { |
| 3618 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3648 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 3619 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPushGroupMarkerEXT(" | 3649 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPushGroupMarkerEXT(" |
| 3620 << length << ", " << marker << ")"); | 3650 << length << ", " << marker << ")"); |
| 3621 if (!marker) { | 3651 if (!marker) { |
| 3622 marker = ""; | 3652 marker = ""; |
| 3623 } | 3653 } |
| 3624 SetBucketAsString( | 3654 SetBucketAsString( |
| 3625 kResultBucketId, | 3655 kResultBucketId, |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4140 return true; | 4170 return true; |
| 4141 } | 4171 } |
| 4142 | 4172 |
| 4143 // Include the auto-generated part of this file. We split this because it means | 4173 // Include the auto-generated part of this file. We split this because it means |
| 4144 // we can easily edit the non-auto generated parts right here in this file | 4174 // we can easily edit the non-auto generated parts right here in this file |
| 4145 // instead of having to edit some template or the code generator. | 4175 // instead of having to edit some template or the code generator. |
| 4146 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 4176 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 4147 | 4177 |
| 4148 } // namespace gles2 | 4178 } // namespace gles2 |
| 4149 } // namespace gpu | 4179 } // namespace gpu |
| OLD | NEW |