| 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/common/gpu/client/gl_helper.h" | 5 #include "content/common/gpu/client/gl_helper.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 947 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 948 return texture; | 948 return texture; |
| 949 } | 949 } |
| 950 | 950 |
| 951 void GLHelper::DeleteTexture(GLuint texture_id) { | 951 void GLHelper::DeleteTexture(GLuint texture_id) { |
| 952 gl_->DeleteTextures(1, &texture_id); | 952 gl_->DeleteTextures(1, &texture_id); |
| 953 } | 953 } |
| 954 | 954 |
| 955 uint32 GLHelper::InsertSyncPoint() { return gl_->InsertSyncPointCHROMIUM(); } | 955 uint32 GLHelper::InsertSyncPoint() { return gl_->InsertSyncPointCHROMIUM(); } |
| 956 | 956 |
| 957 void GLHelper::GenerateSyncToken(gpu::SyncToken* sync_token) { | |
| 958 const uint64_t fence_sync = gl_->InsertFenceSyncCHROMIUM(); | |
| 959 gl_->ShallowFlushCHROMIUM(); | |
| 960 gl_->GenSyncTokenCHROMIUM(fence_sync, sync_token->GetData()); | |
| 961 } | |
| 962 | |
| 963 void GLHelper::WaitSyncToken(const gpu::SyncToken& sync_token) { | 957 void GLHelper::WaitSyncToken(const gpu::SyncToken& sync_token) { |
| 964 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); | 958 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); |
| 965 } | 959 } |
| 966 | 960 |
| 967 gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture( | 961 gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture( |
| 968 GLuint texture_id) { | 962 GLuint texture_id) { |
| 969 gpu::Mailbox mailbox; | 963 gpu::Mailbox mailbox; |
| 970 gl_->GenMailboxCHROMIUM(mailbox.name); | 964 gl_->GenMailboxCHROMIUM(mailbox.name); |
| 971 gl_->ProduceTextureDirectCHROMIUM(texture_id, GL_TEXTURE_2D, mailbox.name); | 965 gl_->ProduceTextureDirectCHROMIUM(texture_id, GL_TEXTURE_2D, mailbox.name); |
| 972 return gpu::MailboxHolder(mailbox, gpu::SyncToken(InsertSyncPoint()), | 966 return gpu::MailboxHolder(mailbox, gpu::SyncToken(InsertSyncPoint()), |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 InitCopyTextToImpl(); | 1370 InitCopyTextToImpl(); |
| 1377 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, | 1371 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, |
| 1378 src_size, | 1372 src_size, |
| 1379 src_subrect, | 1373 src_subrect, |
| 1380 dst_size, | 1374 dst_size, |
| 1381 flip_vertically, | 1375 flip_vertically, |
| 1382 use_mrt); | 1376 use_mrt); |
| 1383 } | 1377 } |
| 1384 | 1378 |
| 1385 } // namespace content | 1379 } // namespace content |
| OLD | NEW |