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

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

Issue 11194042: Implement TextureImageTransportSurface using texture mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 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 ef862966fad79849a252fce6cb2f18a8043fd1aa..8f37d0f58417273f25eb0845ba3c1e83736ff61b 100644
--- a/content/common/gpu/client/gl_helper.cc
+++ b/content/common/gpu/client/gl_helper.cc
@@ -271,7 +271,8 @@ class GLHelper::CopyTextureToImpl {
WebKit::WebGLId CopyAndScaleTexture(WebGLId texture,
const gfx::Size& src_size,
- const gfx::Size& dst_size);
+ const gfx::Size& dst_size,
+ WebKit::WebGLId texture_out = 0);
private:
// A single request to CropScaleReadbackAndCleanTexture.
@@ -317,7 +318,8 @@ class GLHelper::CopyTextureToImpl {
WebGLId ScaleTexture(WebGLId src_texture,
const gfx::Size& src_size,
const gfx::Rect& src_subrect,
- const gfx::Size& dst_size);
+ const gfx::Size& dst_size,
+ WebKit::WebGLId texture_out);
// Deletes the context for GLHelperThread.
void DeleteContextForThread();
@@ -423,8 +425,9 @@ WebGLId GLHelper::CopyTextureToImpl::ScaleTexture(
WebGLId src_texture,
const gfx::Size& src_size,
const gfx::Rect& src_subrect,
- const gfx::Size& dst_size) {
- WebGLId dst_texture = context_->createTexture();
+ const gfx::Size& dst_size,
+ WebKit::WebGLId texture_out) {
+ WebGLId dst_texture = texture_out ? texture_out : context_->createTexture();
{
ScopedFramebuffer dst_framebuffer(context_, context_->createFramebuffer());
ScopedFramebufferBinder<GL_FRAMEBUFFER> framebuffer_binder(
@@ -513,7 +516,7 @@ void GLHelper::CopyTextureToImpl::CropScaleReadbackAndCleanTexture(
return;
}
- WebGLId texture = ScaleTexture(src_texture, src_size, src_subrect, dst_size);
+ WebGLId texture = ScaleTexture(src_texture, src_size, src_subrect, dst_size, 0);
context_->flush();
scoped_refptr<Request> request =
new Request(this, texture, dst_size, out, callback);
@@ -550,8 +553,10 @@ void GLHelper::CopyTextureToImpl::ReadbackTextureSync(WebGLId texture,
WebKit::WebGLId GLHelper::CopyTextureToImpl::CopyAndScaleTexture(
WebGLId src_texture,
const gfx::Size& src_size,
- const gfx::Size& dst_size) {
- return ScaleTexture(src_texture, src_size, gfx::Rect(src_size), dst_size);
+ const gfx::Size& dst_size,
+ WebKit::WebGLId texture_out) {
+ return ScaleTexture(src_texture, src_size, gfx::Rect(src_size), dst_size,
+ texture_out);
}
void GLHelper::CopyTextureToImpl::ReadBackFramebuffer(
@@ -713,18 +718,22 @@ void GLHelper::ReadbackTextureSync(WebKit::WebGLId texture,
}
WebKit::WebGLId GLHelper::CopyTexture(WebKit::WebGLId texture,
- const gfx::Size& size) {
+ const gfx::Size& size,
+ WebKit::WebGLId texture_out) {
InitCopyTextToImpl();
- return copy_texture_to_impl_->CopyAndScaleTexture(texture, size, size);
+ return copy_texture_to_impl_->CopyAndScaleTexture(texture, size, size,
+ texture_out);
}
WebKit::WebGLId GLHelper::CopyAndScaleTexture(WebKit::WebGLId texture,
const gfx::Size& src_size,
- const gfx::Size& dst_size) {
+ const gfx::Size& dst_size,
+ WebKit::WebGLId texture_out) {
InitCopyTextToImpl();
return copy_texture_to_impl_->CopyAndScaleTexture(texture,
src_size,
- dst_size);
+ dst_size,
+ texture_out);
}
WebGLId GLHelper::CompileShaderFromSource(

Powered by Google App Engine
This is Rietveld 408576698