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_->Flush(); | |
piman
2015/11/05 00:04:36
ShallowFlushCHROMIUM (same reason as above).
David Yen
2015/11/05 00:34:27
Done.
| |
960 gl_->GenSyncTokenCHROMIUM(fence_sync, sync_token->GetData()); | |
961 } | |
962 | |
957 void GLHelper::WaitSyncToken(const gpu::SyncToken& sync_token) { | 963 void GLHelper::WaitSyncToken(const gpu::SyncToken& sync_token) { |
958 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); | 964 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); |
959 } | 965 } |
960 | 966 |
961 gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture( | 967 gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture( |
962 GLuint texture_id) { | 968 GLuint texture_id) { |
963 gpu::Mailbox mailbox; | 969 gpu::Mailbox mailbox; |
964 gl_->GenMailboxCHROMIUM(mailbox.name); | 970 gl_->GenMailboxCHROMIUM(mailbox.name); |
965 gl_->ProduceTextureDirectCHROMIUM(texture_id, GL_TEXTURE_2D, mailbox.name); | 971 gl_->ProduceTextureDirectCHROMIUM(texture_id, GL_TEXTURE_2D, mailbox.name); |
966 return gpu::MailboxHolder(mailbox, gpu::SyncToken(InsertSyncPoint()), | 972 return gpu::MailboxHolder(mailbox, gpu::SyncToken(InsertSyncPoint()), |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1370 InitCopyTextToImpl(); | 1376 InitCopyTextToImpl(); |
1371 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, | 1377 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, |
1372 src_size, | 1378 src_size, |
1373 src_subrect, | 1379 src_subrect, |
1374 dst_size, | 1380 dst_size, |
1375 flip_vertically, | 1381 flip_vertically, |
1376 use_mrt); | 1382 use_mrt); |
1377 } | 1383 } |
1378 | 1384 |
1379 } // namespace content | 1385 } // namespace content |
OLD | NEW |