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

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

Issue 1161853006: Mac: Add partial swap support to NSOpenGLContext path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 5 years, 6 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
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/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #if defined(OS_MACOSX) 89 #if defined(OS_MACOSX)
90 IPC_MESSAGE_HANDLER(AcceleratedSurfaceMsg_BufferPresented, 90 IPC_MESSAGE_HANDLER(AcceleratedSurfaceMsg_BufferPresented,
91 OnBufferPresented) 91 OnBufferPresented)
92 #endif 92 #endif
93 IPC_MESSAGE_HANDLER(AcceleratedSurfaceMsg_WakeUpGpu, OnWakeUpGpu); 93 IPC_MESSAGE_HANDLER(AcceleratedSurfaceMsg_WakeUpGpu, OnWakeUpGpu);
94 IPC_MESSAGE_UNHANDLED(handled = false) 94 IPC_MESSAGE_UNHANDLED(handled = false)
95 IPC_END_MESSAGE_MAP() 95 IPC_END_MESSAGE_MAP()
96 return handled; 96 return handled;
97 } 97 }
98 98
99 #if defined(OS_MACOSX)
99 void ImageTransportHelper::SendAcceleratedSurfaceBuffersSwapped( 100 void ImageTransportHelper::SendAcceleratedSurfaceBuffersSwapped(
100 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params) { 101 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params) {
101 // TRACE_EVENT for gpu tests: 102 // TRACE_EVENT for gpu tests:
102 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", 103 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers",
103 TRACE_EVENT_SCOPE_THREAD, 104 TRACE_EVENT_SCOPE_THREAD,
104 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), 105 "GLImpl", static_cast<int>(gfx::GetGLImplementation()),
105 "width", params.size.width()); 106 "width", params.size.width());
106 params.surface_id = stub_->surface_id(); 107 params.surface_id = stub_->surface_id();
107 params.route_id = route_id_; 108 params.route_id = route_id_;
108 manager_->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params)); 109 manager_->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params));
109 } 110 }
111 #endif
110 112
111 void ImageTransportHelper::SetPreemptByFlag( 113 void ImageTransportHelper::SetPreemptByFlag(
112 scoped_refptr<gpu::PreemptionFlag> preemption_flag) { 114 scoped_refptr<gpu::PreemptionFlag> preemption_flag) {
113 stub_->channel()->SetPreemptByFlag(preemption_flag); 115 stub_->channel()->SetPreemptByFlag(preemption_flag);
114 } 116 }
115 117
116 bool ImageTransportHelper::MakeCurrent() { 118 bool ImageTransportHelper::MakeCurrent() {
117 gpu::gles2::GLES2Decoder* decoder = Decoder(); 119 gpu::gles2::GLES2Decoder* decoder = Decoder();
118 if (!decoder) 120 if (!decoder)
119 return false; 121 return false;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() { 288 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() {
287 gfx::VSyncProvider* vsync_provider = GetVSyncProvider(); 289 gfx::VSyncProvider* vsync_provider = GetVSyncProvider();
288 if (vsync_provider) { 290 if (vsync_provider) {
289 vsync_provider->GetVSyncParameters( 291 vsync_provider->GetVSyncParameters(
290 base::Bind(&GpuCommandBufferStub::SendUpdateVSyncParameters, 292 base::Bind(&GpuCommandBufferStub::SendUpdateVSyncParameters,
291 helper_->stub()->AsWeakPtr())); 293 helper_->stub()->AsWeakPtr()));
292 } 294 }
293 } 295 }
294 296
295 } // namespace content 297 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/image_transport_surface.h ('k') | content/common/gpu/image_transport_surface_fbo_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698