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

Side by Side Diff: content/renderer/gpu/compositor_output_surface.h

Issue 19331002: Associate an id with the output surface to handle lost contexts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android, tests Created 7 years, 5 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 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ 5 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ 6 #define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 26 matching lines...) Expand all
37 // This class can be created only on the main thread, but then becomes pinned 37 // This class can be created only on the main thread, but then becomes pinned
38 // to a fixed thread when bindToClient is called. 38 // to a fixed thread when bindToClient is called.
39 class CompositorOutputSurface 39 class CompositorOutputSurface
40 : NON_EXPORTED_BASE(public cc::OutputSurface), 40 : NON_EXPORTED_BASE(public cc::OutputSurface),
41 NON_EXPORTED_BASE(public base::NonThreadSafe) { 41 NON_EXPORTED_BASE(public base::NonThreadSafe) {
42 public: 42 public:
43 static IPC::ForwardingMessageFilter* CreateFilter( 43 static IPC::ForwardingMessageFilter* CreateFilter(
44 base::TaskRunner* target_task_runner); 44 base::TaskRunner* target_task_runner);
45 45
46 CompositorOutputSurface(int32 routing_id, 46 CompositorOutputSurface(int32 routing_id,
47 uint32 output_surface_id,
47 WebGraphicsContext3DCommandBufferImpl* context3d, 48 WebGraphicsContext3DCommandBufferImpl* context3d,
48 cc::SoftwareOutputDevice* software, 49 cc::SoftwareOutputDevice* software,
49 bool use_swap_compositor_frame_message); 50 bool use_swap_compositor_frame_message);
50 virtual ~CompositorOutputSurface(); 51 virtual ~CompositorOutputSurface();
51 52
52 // cc::OutputSurface implementation. 53 // cc::OutputSurface implementation.
53 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE; 54 virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE;
54 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; 55 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE;
55 #if defined(OS_ANDROID) 56 #if defined(OS_ANDROID)
56 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; 57 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE;
57 #endif 58 #endif
58 59
59 // TODO(epenner): This seems out of place here and would be a better fit 60 // TODO(epenner): This seems out of place here and would be a better fit
60 // int CompositorThread after it is fully refactored (http://crbug/170828) 61 // int CompositorThread after it is fully refactored (http://crbug/170828)
61 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) OVERRIDE; 62 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) OVERRIDE;
62 63
63 protected: 64 protected:
64 virtual void OnSwapAck(const cc::CompositorFrameAck& ack); 65 virtual void OnSwapAck(uint32 output_surface_id,
66 const cc::CompositorFrameAck& ack);
67 uint32 output_surface_id_;
65 68
66 private: 69 private:
67 class CompositorOutputSurfaceProxy : 70 class CompositorOutputSurfaceProxy :
68 public base::RefCountedThreadSafe<CompositorOutputSurfaceProxy> { 71 public base::RefCountedThreadSafe<CompositorOutputSurfaceProxy> {
69 public: 72 public:
70 explicit CompositorOutputSurfaceProxy( 73 explicit CompositorOutputSurfaceProxy(
71 CompositorOutputSurface* output_surface) 74 CompositorOutputSurface* output_surface)
72 : output_surface_(output_surface) {} 75 : output_surface_(output_surface) {}
73 void ClearOutputSurface() { output_surface_ = NULL; } 76 void ClearOutputSurface() { output_surface_ = NULL; }
74 void OnMessageReceived(const IPC::Message& message) { 77 void OnMessageReceived(const IPC::Message& message) {
(...skipping 23 matching lines...) Expand all
98 scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_; 101 scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_;
99 scoped_refptr<IPC::SyncMessageFilter> message_sender_; 102 scoped_refptr<IPC::SyncMessageFilter> message_sender_;
100 int routing_id_; 103 int routing_id_;
101 bool prefers_smoothness_; 104 bool prefers_smoothness_;
102 base::PlatformThreadHandle main_thread_handle_; 105 base::PlatformThreadHandle main_thread_handle_;
103 }; 106 };
104 107
105 } // namespace content 108 } // namespace content
106 109
107 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ 110 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698