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

Side by Side Diff: content/common/gpu/texture_image_transport_surface.cc

Issue 12252028: Fix race with short-lived TextureImageTransportSurfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/gpu/texture_image_transport_surface.h" 5 #include "content/common/gpu/texture_image_transport_surface.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 108
109 bool TextureImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) { 109 bool TextureImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) {
110 if (stub_destroyed_) { 110 if (stub_destroyed_) {
111 // Early-exit so that we don't recreate the fbo. We still want to return 111 // Early-exit so that we don't recreate the fbo. We still want to return
112 // true, so that the context is made current and the GLES2DecoderImpl can 112 // true, so that the context is made current and the GLES2DecoderImpl can
113 // release its own resources. 113 // release its own resources.
114 return true; 114 return true;
115 } 115 }
116 116
117 if (!context_.get()) { 117 context_ = context;
118 DCHECK(helper_->stub());
119 context_ = helper_->stub()->decoder()->GetGLContext();
120 }
121 118
122 if (!fbo_id_) { 119 if (!fbo_id_) {
123 glGenFramebuffersEXT(1, &fbo_id_); 120 glGenFramebuffersEXT(1, &fbo_id_);
124 glBindFramebufferEXT(GL_FRAMEBUFFER, fbo_id_); 121 glBindFramebufferEXT(GL_FRAMEBUFFER, fbo_id_);
125 current_size_ = gfx::Size(1, 1); 122 current_size_ = gfx::Size(1, 1);
126 helper_->stub()->AddDestructionObserver(this); 123 helper_->stub()->AddDestructionObserver(this);
127 } 124 }
128 125
129 // We could be receiving non-deferred GL commands, that is anything that does 126 // We could be receiving non-deferred GL commands, that is anything that does
130 // not need a framebuffer. 127 // not need a framebuffer.
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 GL_TEXTURE_2D, 476 GL_TEXTURE_2D,
480 texture->mailbox_name, 477 texture->mailbox_name,
481 definition.release(), 478 definition.release(),
482 NULL); 479 NULL);
483 DCHECK(success); 480 DCHECK(success);
484 texture->service_id = 0; 481 texture->service_id = 0;
485 texture->mailbox_name = MailboxName(); 482 texture->mailbox_name = MailboxName();
486 } 483 }
487 484
488 } // namespace content 485 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698