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); |
| 3642 if (share_group_->bind_generates_resource()) |
| 3643 helper_->CommandBufferHelper::Flush(); |
| 3644 CheckGLError(); |
| 3645 return client_id; |
| 3646 } |
| 3647 |
3616 void GLES2Implementation::PushGroupMarkerEXT( | 3648 void GLES2Implementation::PushGroupMarkerEXT( |
3617 GLsizei length, const GLchar* marker) { | 3649 GLsizei length, const GLchar* marker) { |
3618 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3650 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
3619 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPushGroupMarkerEXT(" | 3651 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPushGroupMarkerEXT(" |
3620 << length << ", " << marker << ")"); | 3652 << length << ", " << marker << ")"); |
3621 if (!marker) { | 3653 if (!marker) { |
3622 marker = ""; | 3654 marker = ""; |
3623 } | 3655 } |
3624 SetBucketAsString( | 3656 SetBucketAsString( |
3625 kResultBucketId, | 3657 kResultBucketId, |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4140 return true; | 4172 return true; |
4141 } | 4173 } |
4142 | 4174 |
4143 // Include the auto-generated part of this file. We split this because it means | 4175 // 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 | 4176 // 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. | 4177 // instead of having to edit some template or the code generator. |
4146 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 4178 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
4147 | 4179 |
4148 } // namespace gles2 | 4180 } // namespace gles2 |
4149 } // namespace gpu | 4181 } // namespace gpu |
OLD | NEW |