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

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

Issue 17971002: Make RenderWidgetHostViewAura::CopyFromCompositingSurface readback layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tabcapture-aura: SpellingIsHardLetsGoShopping Created 7 years, 6 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
« no previous file with comments | « content/common/gpu/client/gl_helper.h ('k') | content/port/browser/render_widget_host_view_port.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4bfd440755c45ea543476715b45e5aff15cfac0a..e4876b19b5b8c438b1917999d9b8afece6dd67fd 100644
--- a/content/common/gpu/client/gl_helper.cc
+++ b/content/common/gpu/client/gl_helper.cc
@@ -16,6 +16,7 @@
#include "base/time/time.h"
#include "cc/resources/sync_point_helper.h"
#include "content/common/gpu/client/gl_helper_scaling.h"
+#include "gpu/command_buffer/common/mailbox.h"
#include "media/base/video_frame.h"
#include "media/base/video_util.h"
#include "third_party/WebKit/public/platform/WebCString.h"
@@ -541,6 +542,20 @@ void GLHelper::CropScaleReadbackAndCleanTexture(
GLHelper::SCALER_QUALITY_FAST);
}
+void GLHelper::CropScaleReadbackAndCleanMailbox(
+ const gpu::Mailbox& src_mailbox,
+ uint32 sync_point,
+ const gfx::Size& src_size,
+ const gfx::Rect& src_subrect,
+ const gfx::Size& dst_size,
+ unsigned char* out,
+ const base::Callback<void(bool)>& callback) {
+ WebGLId mailbox_texture = ConsumeMailboxToTexture(src_mailbox, sync_point);
+ CropScaleReadbackAndCleanTexture(
+ mailbox_texture, src_size, src_subrect, dst_size, out, callback);
+ context_->deleteTexture(mailbox_texture);
+}
+
void GLHelper::ReadbackTextureSync(WebKit::WebGLId texture,
const gfx::Rect& src_rect,
unsigned char* out) {
@@ -645,6 +660,19 @@ WebKit::WebGLId GLHelper::CreateTexture() {
return texture;
}
+WebKit::WebGLId GLHelper::ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
+ uint32 sync_point) {
+ if (mailbox.IsZero())
+ return 0;
+ if (sync_point)
+ context_->waitSyncPoint(sync_point);
+ WebKit::WebGLId texture = CreateTexture();
+ content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(context_,
+ texture);
+ context_->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
+ return texture;
+}
+
void GLHelper::ResizeTexture(WebKit::WebGLId texture, const gfx::Size& size) {
content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(context_, texture);
context_->texImage2D(GL_TEXTURE_2D, 0, GL_RGB,
« no previous file with comments | « content/common/gpu/client/gl_helper.h ('k') | content/port/browser/render_widget_host_view_port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698