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

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

Issue 14081010: Cleanup: Remove unnecessary ".get()" from scoped_ptrs<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some gtk issues Created 7 years, 8 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
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/image_transport_surface.h" 5 #include "content/common/gpu/image_transport_surface.h"
6 6
7 #include "base/mac/scoped_cftyperef.h" 7 #include "base/mac/scoped_cftyperef.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "content/common/gpu/gpu_messages.h" 9 #include "content/common/gpu/gpu_messages.h"
10 #include "ui/gfx/native_widget_types.h" 10 #include "ui/gfx/native_widget_types.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 211
212 void IOSurfaceImageTransportSurface::AdjustBufferAllocation() { 212 void IOSurfaceImageTransportSurface::AdjustBufferAllocation() {
213 // On mac, the frontbuffer and backbuffer are the same buffer. The buffer is 213 // On mac, the frontbuffer and backbuffer are the same buffer. The buffer is
214 // free'd when both the browser and gpu processes have Unref'd the IOSurface. 214 // free'd when both the browser and gpu processes have Unref'd the IOSurface.
215 if (!backbuffer_suggested_allocation_ && 215 if (!backbuffer_suggested_allocation_ &&
216 !frontbuffer_suggested_allocation_ && 216 !frontbuffer_suggested_allocation_ &&
217 io_surface_.get()) { 217 io_surface_.get()) {
218 UnrefIOSurface(); 218 UnrefIOSurface();
219 helper_->Suspend(); 219 helper_->Suspend();
220 } else if (backbuffer_suggested_allocation_ && !io_surface_.get()) { 220 } else if (backbuffer_suggested_allocation_ && !io_surface_) {
221 CreateIOSurface(); 221 CreateIOSurface();
222 } 222 }
223 } 223 }
224 224
225 bool IOSurfaceImageTransportSurface::SwapBuffers() { 225 bool IOSurfaceImageTransportSurface::SwapBuffers() {
226 DCHECK(backbuffer_suggested_allocation_); 226 DCHECK(backbuffer_suggested_allocation_);
227 if (!frontbuffer_suggested_allocation_) 227 if (!frontbuffer_suggested_allocation_)
228 return true; 228 return true;
229 glFlush(); 229 glFlush();
230 230
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 manager, stub, surface.get(), false)); 478 manager, stub, surface.get(), false));
479 } 479 }
480 } 480 }
481 481
482 // static 482 // static
483 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) { 483 void ImageTransportSurface::SetAllowOSMesaForTesting(bool allow) {
484 g_allow_os_mesa = allow; 484 g_allow_os_mesa = allow;
485 } 485 }
486 486
487 } // namespace content 487 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/image_transport_surface.cc ('k') | content/common/gpu/image_transport_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698