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

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

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
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/common/gpu/image_transport_surface.cc » ('j') | 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 #ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ 5 #ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_
6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ 6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
16 #include "ipc/ipc_listener.h" 16 #include "ipc/ipc_listener.h"
17 #include "ipc/ipc_message.h" 17 #include "ipc/ipc_message.h"
18 #include "ui/events/latency_info.h" 18 #include "ui/events/latency_info.h"
19 #include "ui/gfx/geometry/rect.h" 19 #include "ui/gfx/geometry/rect.h"
20 #include "ui/gfx/geometry/size.h" 20 #include "ui/gfx/geometry/size.h"
21 #include "ui/gfx/native_widget_types.h" 21 #include "ui/gfx/native_widget_types.h"
22 #include "ui/gfx/swap_result.h" 22 #include "ui/gfx/swap_result.h"
23 #include "ui/gl/gl_surface.h" 23 #include "ui/gl/gl_surface.h"
24 24
25 #if defined(OS_MACOSX)
25 struct AcceleratedSurfaceMsg_BufferPresented_Params; 26 struct AcceleratedSurfaceMsg_BufferPresented_Params;
26 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; 27 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params;
28 #endif
27 29
28 namespace gfx { 30 namespace gfx {
29 class GLSurface; 31 class GLSurface;
30 } 32 }
31 33
32 namespace gpu { 34 namespace gpu {
33 class PreemptionFlag; 35 class PreemptionFlag;
34 namespace gles2 { 36 namespace gles2 {
35 class GLES2Decoder; 37 class GLES2Decoder;
36 } 38 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 gfx::PluginWindowHandle handle); 117 gfx::PluginWindowHandle handle);
116 ~ImageTransportHelper() override; 118 ~ImageTransportHelper() override;
117 119
118 bool Initialize(); 120 bool Initialize();
119 121
120 // IPC::Listener implementation: 122 // IPC::Listener implementation:
121 bool OnMessageReceived(const IPC::Message& message) override; 123 bool OnMessageReceived(const IPC::Message& message) override;
122 124
123 // Helper send functions. Caller fills in the surface specific params 125 // Helper send functions. Caller fills in the surface specific params
124 // like size and surface id. The helper fills in the rest. 126 // like size and surface id. The helper fills in the rest.
127 #if defined(OS_MACOSX)
125 void SendAcceleratedSurfaceBuffersSwapped( 128 void SendAcceleratedSurfaceBuffersSwapped(
126 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params); 129 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params);
130 #endif
127 131
128 void SetPreemptByFlag( 132 void SetPreemptByFlag(
129 scoped_refptr<gpu::PreemptionFlag> preemption_flag); 133 scoped_refptr<gpu::PreemptionFlag> preemption_flag);
130 134
131 // Make the surface's context current. 135 // Make the surface's context current.
132 bool MakeCurrent(); 136 bool MakeCurrent();
133 137
134 // Set the default swap interval on the surface. 138 // Set the default swap interval on the surface.
135 static void SetSwapInterval(gfx::GLContext* context); 139 static void SetSwapInterval(gfx::GLContext* context);
136 140
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 bool did_set_swap_interval_; 211 bool did_set_swap_interval_;
208 std::vector<ui::LatencyInfo> latency_info_; 212 std::vector<ui::LatencyInfo> latency_info_;
209 base::WeakPtrFactory<PassThroughImageTransportSurface> weak_ptr_factory_; 213 base::WeakPtrFactory<PassThroughImageTransportSurface> weak_ptr_factory_;
210 214
211 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface); 215 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface);
212 }; 216 };
213 217
214 } // namespace content 218 } // namespace content
215 219
216 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ 220 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/common/gpu/image_transport_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698