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

Unified Diff: content/renderer/gpu/mailbox_output_surface.cc

Issue 16305019: Simplify mailbox handling in MailboxOutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/renderer/gpu/mailbox_output_surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/mailbox_output_surface.cc
diff --git a/content/renderer/gpu/mailbox_output_surface.cc b/content/renderer/gpu/mailbox_output_surface.cc
index c1166fc80e8343914beffec432a9e6a1651ee884..3af09e29337a4526d95466691a70b869781a4a55 100644
--- a/content/renderer/gpu/mailbox_output_surface.cc
+++ b/content/renderer/gpu/mailbox_output_surface.cc
@@ -47,12 +47,10 @@ void MailboxOutputSurface::EnsureBackbuffer() {
TransferableFrame& texture = returned_textures_.front();
if (texture.size == size_) {
current_backing_ = texture;
- ConsumeTexture(texture);
returned_textures_.pop();
break;
}
- ConsumeTexture(texture);
context3d_->deleteTexture(texture.texture_id);
returned_textures_.pop();
}
@@ -60,7 +58,6 @@ void MailboxOutputSurface::EnsureBackbuffer() {
if (!current_backing_.texture_id) {
current_backing_.texture_id = context3d_->createTexture();
current_backing_.size = size_;
- context3d_->genMailboxCHROMIUM(current_backing_.mailbox.name);
context3d_->bindTexture(GL_TEXTURE_2D, current_backing_.texture_id);
context3d_->texParameteri(
GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -73,6 +70,9 @@ void MailboxOutputSurface::EnsureBackbuffer() {
context3d_->texImage2D(
GL_TEXTURE_2D, 0, GL_RGBA, size_.width(), size_.height(), 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ context3d_->genMailboxCHROMIUM(current_backing_.mailbox.name);
+ context3d_->produceTextureCHROMIUM(
+ GL_TEXTURE_2D, current_backing_.mailbox.name);
}
}
}
@@ -87,7 +87,6 @@ void MailboxOutputSurface::DiscardBackbuffer() {
while (!returned_textures_.empty()) {
const TransferableFrame& frame = returned_textures_.front();
- ConsumeTexture(frame);
context3d_->deleteTexture(frame.texture_id);
returned_textures_.pop();
}
@@ -128,12 +127,6 @@ void MailboxOutputSurface::SendFrameToParentCompositor(
DCHECK(size_ == current_backing_.size);
DCHECK(!current_backing_.mailbox.IsZero());
- context3d_->framebufferTexture2D(
- GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
no sievers 2013/06/03 22:03:51 This was necessary for some Android driver that ha
- context3d_->bindFramebuffer(GL_FRAMEBUFFER, 0);
- context3d_->bindTexture(GL_TEXTURE_2D, current_backing_.texture_id);
- context3d_->produceTextureCHROMIUM(
- GL_TEXTURE_2D, current_backing_.mailbox.name);
frame->gl_frame_data->mailbox = current_backing_.mailbox;
frame->gl_frame_data->size = current_backing_.size;
context3d_->flush();
@@ -165,7 +158,6 @@ void MailboxOutputSurface::OnSwapAck(const cc::CompositorFrameAck& ack) {
if (!is_backbuffer_discarded_) {
returned_textures_.push(*it);
} else {
- ConsumeTexture(*it);
context3d_->deleteTexture(it->texture_id);
}
@@ -195,15 +187,6 @@ void MailboxOutputSurface::PostSubBuffer(gfx::Rect rect,
DCHECK(GetNumAcksPending() < 2);
}
-void MailboxOutputSurface::ConsumeTexture(const TransferableFrame& frame) {
- DCHECK(!frame.mailbox.IsZero());
- if (frame.sync_point)
- context3d_->waitSyncPoint(frame.sync_point);
-
- context3d_->bindTexture(GL_TEXTURE_2D, frame.texture_id);
- context3d_->consumeTextureCHROMIUM(GL_TEXTURE_2D, frame.mailbox.name);
-}
-
size_t MailboxOutputSurface::GetNumAcksPending() {
DCHECK(pending_textures_.size());
return pending_textures_.size() - 1;
« no previous file with comments | « content/renderer/gpu/mailbox_output_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698