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

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

Issue 1166463004: Revert of Adding status to swap complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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"
23 #include "ui/gl/gl_surface.h" 22 #include "ui/gl/gl_surface.h"
24 23
25 struct AcceleratedSurfaceMsg_BufferPresented_Params; 24 struct AcceleratedSurfaceMsg_BufferPresented_Params;
26 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; 25 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params;
27 26
28 namespace gfx { 27 namespace gfx {
29 class GLSurface; 28 class GLSurface;
30 } 29 }
31 30
32 namespace gpu { 31 namespace gpu {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 : public gfx::GLSurfaceAdapter, 168 : public gfx::GLSurfaceAdapter,
170 public ImageTransportSurface { 169 public ImageTransportSurface {
171 public: 170 public:
172 PassThroughImageTransportSurface(GpuChannelManager* manager, 171 PassThroughImageTransportSurface(GpuChannelManager* manager,
173 GpuCommandBufferStub* stub, 172 GpuCommandBufferStub* stub,
174 gfx::GLSurface* surface); 173 gfx::GLSurface* surface);
175 174
176 // GLSurface implementation. 175 // GLSurface implementation.
177 bool Initialize() override; 176 bool Initialize() override;
178 void Destroy() override; 177 void Destroy() override;
179 gfx::SwapResult SwapBuffers() override; 178 bool SwapBuffers() override;
180 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; 179 bool PostSubBuffer(int x, int y, int width, int height) override;
181 bool OnMakeCurrent(gfx::GLContext* context) override; 180 bool OnMakeCurrent(gfx::GLContext* context) override;
182 181
183 // ImageTransportSurface implementation. 182 // ImageTransportSurface implementation.
184 #if defined(OS_MACOSX) 183 #if defined(OS_MACOSX)
185 void OnBufferPresented( 184 void OnBufferPresented(
186 const AcceleratedSurfaceMsg_BufferPresented_Params& params) override; 185 const AcceleratedSurfaceMsg_BufferPresented_Params& params) override;
187 #endif 186 #endif
188 void OnResize(gfx::Size size, float scale_factor) override; 187 void OnResize(gfx::Size size, float scale_factor) override;
189 gfx::Size GetSize() override; 188 gfx::Size GetSize() override;
190 void SetLatencyInfo( 189 void SetLatencyInfo(
191 const std::vector<ui::LatencyInfo>& latency_info) override; 190 const std::vector<ui::LatencyInfo>& latency_info) override;
192 void WakeUpGpu() override; 191 void WakeUpGpu() override;
193 192
194 protected: 193 protected:
195 ~PassThroughImageTransportSurface() override; 194 ~PassThroughImageTransportSurface() override;
196 195
197 // If updated vsync parameters can be determined, send this information to 196 // If updated vsync parameters can be determined, send this information to
198 // the browser. 197 // the browser.
199 virtual void SendVSyncUpdateIfAvailable(); 198 virtual void SendVSyncUpdateIfAvailable();
200 void SwapBuffersCallBack(std::vector<ui::LatencyInfo>* latency_info_ptr, 199 void SwapBuffersCallBack(std::vector<ui::LatencyInfo>* latency_info_ptr);
201 gfx::SwapResult result);
202 200
203 ImageTransportHelper* GetHelper() { return helper_.get(); } 201 ImageTransportHelper* GetHelper() { return helper_.get(); }
204 202
205 private: 203 private:
206 scoped_ptr<ImageTransportHelper> helper_; 204 scoped_ptr<ImageTransportHelper> helper_;
207 bool did_set_swap_interval_; 205 bool did_set_swap_interval_;
208 std::vector<ui::LatencyInfo> latency_info_; 206 std::vector<ui::LatencyInfo> latency_info_;
209 base::WeakPtrFactory<PassThroughImageTransportSurface> weak_ptr_factory_; 207 base::WeakPtrFactory<PassThroughImageTransportSurface> weak_ptr_factory_;
210 208
211 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface); 209 DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface);
212 }; 210 };
213 211
214 } // namespace content 212 } // namespace content
215 213
216 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_ 214 #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