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

Side by Side Diff: content/common/gpu/media/avda_codec_image.cc

Issue 1415723006: ui: Add RGBX_8888 buffer format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/media/avda_codec_image.h" 5 #include "content/common/gpu/media/avda_codec_image.h"
6 6
7 #include "content/common/gpu/media/avda_shared_state.h" 7 #include "content/common/gpu/media/avda_shared_state.h"
8 #include "gpu/command_buffer/service/context_group.h" 8 #include "gpu/command_buffer/service/context_group.h"
9 #include "gpu/command_buffer/service/context_state.h" 9 #include "gpu/command_buffer/service/context_state.h"
10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 glBindTexture(GL_TEXTURE_EXTERNAL_OES, 80 glBindTexture(GL_TEXTURE_EXTERNAL_OES,
81 shared_state_->surface_texture_service_id()); 81 shared_state_->surface_texture_service_id());
82 82
83 // TODO(liberato): Handle the texture matrix properly. 83 // TODO(liberato): Handle the texture matrix properly.
84 // Either we can update the shader with it or we can move all of the logic 84 // Either we can update the shader with it or we can move all of the logic
85 // to updateTexImage() to the right place in the cc to send it to the shader. 85 // to updateTexImage() to the right place in the cc to send it to the shader.
86 // For now, we just skip it. crbug.com/530681 86 // For now, we just skip it. crbug.com/530681
87 87
88 gpu::gles2::TextureManager* texture_manager = 88 gpu::gles2::TextureManager* texture_manager =
89 decoder_->GetContextGroup()->texture_manager(); 89 decoder_->GetContextGroup()->texture_manager();
90 gpu::gles2::Texture* texture = 90 gpu::gles2::Texture* texture = texture_manager->GetTextureForServiceId(
91 texture_manager->GetTextureForServiceId( 91 shared_state_->surface_texture_service_id());
92 shared_state_->surface_texture_service_id());
93 if (texture) { 92 if (texture) {
94 // By setting image state to UNBOUND instead of COPIED we ensure that 93 // By setting image state to UNBOUND instead of COPIED we ensure that
95 // CopyTexImage() is called each time the surface texture is used for 94 // CopyTexImage() is called each time the surface texture is used for
96 // drawing. 95 // drawing.
97 texture->SetLevelImage(GL_TEXTURE_EXTERNAL_OES, 0, this, 96 texture->SetLevelImage(GL_TEXTURE_EXTERNAL_OES, 0, this,
98 gpu::gles2::Texture::UNBOUND); 97 gpu::gles2::Texture::UNBOUND);
99 } 98 }
100 99
101 return true; 100 return true;
102 } 101 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 175
177 // The surface texture is already detached, so just attach it. 176 // The surface texture is already detached, so just attach it.
178 surface_texture_->AttachToGLContext(); 177 surface_texture_->AttachToGLContext();
179 shared_state_->set_surface_texture_service_id(surface_texture_service_id); 178 shared_state_->set_surface_texture_service_id(surface_texture_service_id);
180 detach_surface_texture_on_destruction_ = true; 179 detach_surface_texture_on_destruction_ = true;
181 180
182 // We do not restore the GL state here. 181 // We do not restore the GL state here.
183 } 182 }
184 183
185 } // namespace content 184 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698