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

Side by Side Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.cc

Issue 200763011: Add explicit flush after copyTextureCHROMIUM to make the change visible accross contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/media/renderer_gpu_video_accelerator_factories.h" 5 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 GLuint tmp_texture; 180 GLuint tmp_texture;
181 gles2->GenTextures(1, &tmp_texture); 181 gles2->GenTextures(1, &tmp_texture);
182 gles2->BindTexture(GL_TEXTURE_2D, tmp_texture); 182 gles2->BindTexture(GL_TEXTURE_2D, tmp_texture);
183 gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 183 gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
184 gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 184 gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
185 gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 185 gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
186 gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 186 gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
187 context->copyTextureCHROMIUM( 187 context->copyTextureCHROMIUM(
188 GL_TEXTURE_2D, texture_id, tmp_texture, 0, GL_RGBA, GL_UNSIGNED_BYTE); 188 GL_TEXTURE_2D, texture_id, tmp_texture, 0, GL_RGBA, GL_UNSIGNED_BYTE);
189 context->flush();
no sievers 2014/03/18 22:47:32 Do we need this one? We are reading back the textu
junj 2014/03/19 07:47:37 Yes, the flush() is not needed here. I made a mist
189 190
190 GLuint fb; 191 GLuint fb;
191 gles2->GenFramebuffers(1, &fb); 192 gles2->GenFramebuffers(1, &fb);
192 gles2->BindFramebuffer(GL_FRAMEBUFFER, fb); 193 gles2->BindFramebuffer(GL_FRAMEBUFFER, fb);
193 gles2->FramebufferTexture2D( 194 gles2->FramebufferTexture2D(
194 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tmp_texture, 0); 195 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tmp_texture, 0);
195 gles2->PixelStorei(GL_PACK_ALIGNMENT, 4); 196 gles2->PixelStorei(GL_PACK_ALIGNMENT, 4);
196 #if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \ 197 #if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
197 SK_A32_SHIFT == 24 198 SK_A32_SHIFT == 24
198 GLenum skia_format = GL_BGRA_EXT; 199 GLenum skia_format = GL_BGRA_EXT;
(...skipping 20 matching lines...) Expand all
219 DCHECK(task_runner_->BelongsToCurrentThread()); 220 DCHECK(task_runner_->BelongsToCurrentThread());
220 return ChildThread::AllocateSharedMemory(size, thread_safe_sender_.get()); 221 return ChildThread::AllocateSharedMemory(size, thread_safe_sender_.get());
221 } 222 }
222 223
223 scoped_refptr<base::SingleThreadTaskRunner> 224 scoped_refptr<base::SingleThreadTaskRunner>
224 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { 225 RendererGpuVideoAcceleratorFactories::GetTaskRunner() {
225 return task_runner_; 226 return task_runner_;
226 } 227 }
227 228
228 } // namespace content 229 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698