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

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

Issue 10910263: Don't release/make-current the non-top level texture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "content/common/gpu/image_transport_surface.h" 7 #include "content/common/gpu/image_transport_surface.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 void ImageTransportHelper::OnResizeViewACK() { 215 void ImageTransportHelper::OnResizeViewACK() {
216 surface_->OnResizeViewACK(); 216 surface_->OnResizeViewACK();
217 } 217 }
218 218
219 void ImageTransportHelper::Resize(gfx::Size size) { 219 void ImageTransportHelper::Resize(gfx::Size size) {
220 // On windows, the surface is recreated and, in case the newly allocated 220 // On windows, the surface is recreated and, in case the newly allocated
221 // surface happens to have the same address, it should be invalidated on the 221 // surface happens to have the same address, it should be invalidated on the
222 // decoder so that future calls to MakeCurrent do not early out on the 222 // decoder so that future calls to MakeCurrent do not early out on the
223 // assumption that neither the context or surface have actually changed. 223 // assumption that neither the context or surface have actually changed.
224 #if defined(OS_WIN) 224 #if defined(OS_WIN)
225 Decoder()->ReleaseCurrent(); 225 if (handle_ != NULL)
226 Decoder()->ReleaseCurrent();
226 #endif 227 #endif
227 228
228 surface_->OnResize(size); 229 surface_->OnResize(size);
229 230
230 #if defined(OS_ANDROID) 231 #if defined(OS_ANDROID)
231 manager_->gpu_memory_manager()->ScheduleManage(true); 232 manager_->gpu_memory_manager()->ScheduleManage(true);
232 #endif 233 #endif
233 234
234 #if defined(OS_WIN) 235 #if defined(OS_WIN)
235 Decoder()->MakeCurrent(); 236 if (handle_ != NULL) {
236 SetSwapInterval(Decoder()->GetGLContext()); 237 Decoder()->MakeCurrent();
238 SetSwapInterval(Decoder()->GetGLContext());
239 }
237 #endif 240 #endif
238 } 241 }
239 242
240 PassThroughImageTransportSurface::PassThroughImageTransportSurface( 243 PassThroughImageTransportSurface::PassThroughImageTransportSurface(
241 GpuChannelManager* manager, 244 GpuChannelManager* manager,
242 GpuCommandBufferStub* stub, 245 GpuCommandBufferStub* stub,
243 gfx::GLSurface* surface, 246 gfx::GLSurface* surface,
244 bool transport) 247 bool transport)
245 : GLSurfaceAdapter(surface), 248 : GLSurfaceAdapter(surface),
246 transport_(transport), 249 transport_(transport),
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 } 330 }
328 } 331 }
329 332
330 gfx::Size PassThroughImageTransportSurface::GetSize() { 333 gfx::Size PassThroughImageTransportSurface::GetSize() {
331 return GLSurfaceAdapter::GetSize(); 334 return GLSurfaceAdapter::GetSize();
332 } 335 }
333 336
334 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} 337 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {}
335 338
336 #endif // defined(ENABLE_GPU) 339 #endif // defined(ENABLE_GPU)
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