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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2859723002: Copy NV12 picture buffers on demand on the main thread. (Closed)
Patch Set: share video processors Created 3 years, 7 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: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 49f4fc74411d1b356bb200102ce74d7f6bac8861..2d8cfa0898d25b55432d11520c13022691bb46d6 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9668,7 +9668,11 @@ void GLES2DecoderImpl::DoCopyTexImageIfNeeded(Texture* texture,
ScopedGLErrorSuppressor suppressor(
"GLES2DecoderImpl::DoCopyTexImageIfNeeded", GetErrorState());
glBindTexture(textarget, texture->service_id());
- DoCopyTexImage(texture, textarget, image);
+ if (image->BindTexImage(textarget)) {
+ image_state = Texture::BOUND;
+ } else {
+ DoCopyTexImage(texture, textarget, image);
+ }
RestoreCurrentTextureBindings(&state_, textarget);
}
}
@@ -9733,9 +9737,13 @@ bool GLES2DecoderImpl::PrepareTexturesForRender() {
!texture->IsAttachedToFramebuffer()) {
ScopedGLErrorSuppressor suppressor(
"GLES2DecoderImpl::PrepareTexturesForRender", GetErrorState());
- textures_set = true;
glActiveTexture(GL_TEXTURE0 + texture_unit_index);
- DoCopyTexImage(texture, textarget, image);
+ if (image->BindTexImage(textarget)) {
sandersd (OOO until July 31) 2017/05/23 23:23:31 This is same as the core of DoCopyTexImageIfNeeded
+ image_state = Texture::BOUND;
+ } else {
+ DoCopyTexImage(texture, textarget, image);
+ }
+ textures_set = true;
continue;
}
}
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | media/gpu/dxva_picture_buffer_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698