Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Unified Diff: content/common/gpu/client/gl_helper.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock gpu video accelerator factory Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/client/gl_helper.cc
diff --git a/content/common/gpu/client/gl_helper.cc b/content/common/gpu/client/gl_helper.cc
index e7f81af973fd6a36163c56120afc73a6266eb254..c53b49a881a0f25e3755efc1402b03a11db7b414 100644
--- a/content/common/gpu/client/gl_helper.cc
+++ b/content/common/gpu/client/gl_helper.cc
@@ -133,8 +133,9 @@ class GLHelper::CopyTextureToImpl
~CopyTextureToImpl() { CancelRequests(); }
GLuint ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
- uint32 sync_point) {
- return helper_->ConsumeMailboxToTexture(mailbox, sync_point);
+ uint32 sync_point,
+ const gpu::SyncToken& sync_token) {
+ return helper_->ConsumeMailboxToTexture(mailbox, sync_point, sync_token);
}
void CropScaleReadbackAndCleanTexture(
@@ -274,6 +275,7 @@ class GLHelper::CopyTextureToImpl
void ReadbackYUV(const gpu::Mailbox& mailbox,
uint32 sync_point,
+ const gpu::SyncToken& sync_token,
const scoped_refptr<media::VideoFrame>& target,
const gfx::Point& paste_location,
const base::Callback<void(bool)>& callback) override;
@@ -310,6 +312,7 @@ class GLHelper::CopyTextureToImpl
void ReadbackYUV(const gpu::Mailbox& mailbox,
uint32 sync_point,
+ const gpu::SyncToken& sync_token,
const scoped_refptr<media::VideoFrame>& target,
const gfx::Point& paste_location,
const base::Callback<void(bool)>& callback) override;
@@ -816,6 +819,7 @@ void GLHelper::CropScaleReadbackAndCleanTexture(
void GLHelper::CropScaleReadbackAndCleanMailbox(
const gpu::Mailbox& src_mailbox,
uint32 sync_point,
+ const gpu::SyncToken& sync_token,
const gfx::Size& src_size,
const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
@@ -823,7 +827,8 @@ void GLHelper::CropScaleReadbackAndCleanMailbox(
const SkColorType out_color_type,
const base::Callback<void(bool)>& callback,
GLHelper::ScalerQuality quality) {
- GLuint mailbox_texture = ConsumeMailboxToTexture(src_mailbox, sync_point);
+ GLuint mailbox_texture =
+ ConsumeMailboxToTexture(src_mailbox, sync_point, sync_token);
CropScaleReadbackAndCleanTexture(mailbox_texture,
src_size,
src_subrect,
@@ -954,8 +959,9 @@ void GLHelper::DeleteTexture(GLuint texture_id) {
uint32 GLHelper::InsertSyncPoint() { return gl_->InsertSyncPointCHROMIUM(); }
-void GLHelper::WaitSyncPoint(uint32 sync_point) {
- gl_->WaitSyncPointCHROMIUM(sync_point);
+void GLHelper::WaitSyncPoint(uint32 sync_point,
+ const gpu::SyncToken& sync_token) {
+ gl_->WaitSyncPointCHROMIUM(sync_point, sync_token.GetConstData());
}
gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture(
@@ -963,15 +969,17 @@ gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture(
gpu::Mailbox mailbox;
gl_->GenMailboxCHROMIUM(mailbox.name);
gl_->ProduceTextureDirectCHROMIUM(texture_id, GL_TEXTURE_2D, mailbox.name);
- return gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, InsertSyncPoint());
+ return gpu::MailboxHolder(mailbox, InsertSyncPoint(), gpu::SyncToken(),
+ GL_TEXTURE_2D);
}
GLuint GLHelper::ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
- uint32 sync_point) {
+ uint32 sync_point,
+ const gpu::SyncToken& sync_token) {
if (mailbox.IsZero())
return 0;
- if (sync_point)
- WaitSyncPoint(sync_point);
+ if (sync_point || sync_token.HasData())
+ WaitSyncPoint(sync_point, sync_token);
GLuint texture =
gl_->CreateAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
return texture;
@@ -1118,6 +1126,7 @@ static void CallbackKeepingVideoFrameAlive(
void GLHelper::CopyTextureToImpl::ReadbackYUVImpl::ReadbackYUV(
const gpu::Mailbox& mailbox,
uint32 sync_point,
+ const gpu::SyncToken& sync_token,
const scoped_refptr<media::VideoFrame>& target,
const gfx::Point& paste_location,
const base::Callback<void(bool)>& callback) {
@@ -1125,7 +1134,7 @@ void GLHelper::CopyTextureToImpl::ReadbackYUVImpl::ReadbackYUV(
DCHECK(!(paste_location.y() & 1));
GLuint mailbox_texture =
- copy_impl_->ConsumeMailboxToTexture(mailbox, sync_point);
+ copy_impl_->ConsumeMailboxToTexture(mailbox, sync_point, sync_token);
// Scale texture to right size.
scaler_.Scale(mailbox_texture);
@@ -1239,6 +1248,7 @@ GLHelper::CopyTextureToImpl::ReadbackYUV_MRT::ReadbackYUV_MRT(
void GLHelper::CopyTextureToImpl::ReadbackYUV_MRT::ReadbackYUV(
const gpu::Mailbox& mailbox,
uint32 sync_point,
+ const gpu::SyncToken& sync_token,
const scoped_refptr<media::VideoFrame>& target,
const gfx::Point& paste_location,
const base::Callback<void(bool)>& callback) {
@@ -1246,7 +1256,7 @@ void GLHelper::CopyTextureToImpl::ReadbackYUV_MRT::ReadbackYUV(
DCHECK(!(paste_location.y() & 1));
GLuint mailbox_texture =
- copy_impl_->ConsumeMailboxToTexture(mailbox, sync_point);
+ copy_impl_->ConsumeMailboxToTexture(mailbox, sync_point, sync_token);
GLuint texture;
if (quality_ == GLHelper::SCALER_QUALITY_FAST) {

Powered by Google App Engine
This is Rietveld 408576698