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

Unified Diff: cc/output/gl_renderer.cc

Issue 371463009: Making use of bindless variants mailbox produce/consume on remainders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minimize diff in gl_renderer Created 6 years, 5 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 | « no previous file | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index d249a2f472054b60ac0151cc12d55f93c1e7e43f..382b955a3328487c7d87fa9be060ed3df3085d7a 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2365,23 +2365,12 @@ void GLRenderer::GetFramebufferPixelsAsync(
bool own_mailbox = !request->has_texture_mailbox();
GLuint texture_id = 0;
- gl_->GenTextures(1, &texture_id);
-
gpu::Mailbox mailbox;
if (own_mailbox) {
GLC(gl_, gl_->GenMailboxCHROMIUM(mailbox.name));
- } else {
- mailbox = request->texture_mailbox().mailbox();
- DCHECK_EQ(static_cast<unsigned>(GL_TEXTURE_2D),
- request->texture_mailbox().target());
- DCHECK(!mailbox.IsZero());
- unsigned incoming_sync_point = request->texture_mailbox().sync_point();
- if (incoming_sync_point)
- GLC(gl_, gl_->WaitSyncPointCHROMIUM(incoming_sync_point));
- }
+ gl_->GenTextures(1, &texture_id);
+ GLC(gl_, gl_->BindTexture(GL_TEXTURE_2D, texture_id));
- GLC(gl_, gl_->BindTexture(GL_TEXTURE_2D, texture_id));
- if (own_mailbox) {
GLC(gl_,
gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
GLC(gl_,
@@ -2394,16 +2383,26 @@ void GLRenderer::GetFramebufferPixelsAsync(
GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
GLC(gl_, gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name));
} else {
- GLC(gl_, gl_->ConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name));
+ mailbox = request->texture_mailbox().mailbox();
+ DCHECK_EQ(static_cast<unsigned>(GL_TEXTURE_2D),
+ request->texture_mailbox().target());
+ DCHECK(!mailbox.IsZero());
+ unsigned incoming_sync_point = request->texture_mailbox().sync_point();
+ if (incoming_sync_point)
+ GLC(gl_, gl_->WaitSyncPointCHROMIUM(incoming_sync_point));
+
+ texture_id = GLC(
+ gl_,
+ gl_->CreateAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name));
}
GetFramebufferTexture(texture_id, RGBA_8888, window_rect);
- GLC(gl_, gl_->BindTexture(GL_TEXTURE_2D, 0));
unsigned sync_point = gl_->InsertSyncPointCHROMIUM();
TextureMailbox texture_mailbox(mailbox, GL_TEXTURE_2D, sync_point);
scoped_ptr<SingleReleaseCallback> release_callback;
if (own_mailbox) {
+ GLC(gl_, gl_->BindTexture(GL_TEXTURE_2D, 0));
danakj 2014/07/08 15:51:30 FWIW GetFramebufferTexture already binds/unbinds,
dshwang 2014/07/08 16:36:16 GetFramebufferTexture actually call BindTexture(GL
danakj 2014/07/08 16:40:25 I like having something here to show it's unbound
release_callback = texture_mailbox_deleter_->GetReleaseCallback(
output_surface_->context_provider(), texture_id);
} else {
« no previous file with comments | « no previous file | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698