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

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

Issue 10873099: Flag and adapter class for software compositing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Apply comments and rename everything to "Software" Created 8 years, 3 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 #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/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/threading/non_thread_safe.h" 12 #include "base/threading/non_thread_safe.h"
13 #include "base/time.h" 13 #include "base/time.h"
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput SurfaceSoftware.h"
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h" 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput Surface.h"
15 16
16 namespace base { 17 namespace base {
17 class TaskRunner; 18 class TaskRunner;
18 } 19 }
19 20
20 namespace IPC { 21 namespace IPC {
21 class ForwardingMessageFilter; 22 class ForwardingMessageFilter;
22 class Message; 23 class Message;
23 class SyncChannel; 24 class SyncChannel;
24 } 25 }
25 26
26 // This class can be created only on the main thread, but then becomes pinned 27 // This class can be created only on the main thread, but then becomes pinned
27 // to a fixed thread when bindToClient is called. 28 // to a fixed thread when bindToClient is called.
28 class CompositorOutputSurface 29 class CompositorOutputSurface
29 : NON_EXPORTED_BASE(public WebKit::WebCompositorOutputSurface) 30 : NON_EXPORTED_BASE(public WebKit::WebCompositorOutputSurface)
30 , NON_EXPORTED_BASE(public base::NonThreadSafe) { 31 , NON_EXPORTED_BASE(public base::NonThreadSafe) {
31 public: 32 public:
32 static IPC::ForwardingMessageFilter* CreateFilter( 33 static IPC::ForwardingMessageFilter* CreateFilter(
33 base::TaskRunner* target_task_runner); 34 base::TaskRunner* target_task_runner);
34 35
35 CompositorOutputSurface(int32 routing_id, 36 CompositorOutputSurface(int32 routing_id,
36 WebKit::WebGraphicsContext3D* context3d); 37 WebKit::WebGraphicsContext3D* context3d,
38 WebKit::WebCompositorOutputSurfaceSoftware* software);
37 virtual ~CompositorOutputSurface(); 39 virtual ~CompositorOutputSurface();
38 40
39 // WebCompositorOutputSurface implementation. 41 // WebCompositorOutputSurface implementation.
40 virtual bool bindToClient( 42 virtual bool bindToClient(
41 WebKit::WebCompositorOutputSurfaceClient* client) OVERRIDE; 43 WebKit::WebCompositorOutputSurfaceClient* client) OVERRIDE;
42 virtual const Capabilities& capabilities() const OVERRIDE; 44 virtual const Capabilities& capabilities() const OVERRIDE;
43 virtual WebKit::WebGraphicsContext3D* context3D() const OVERRIDE; 45 virtual WebKit::WebGraphicsContext3D* context3D() const OVERRIDE;
46 virtual WebKit::WebCompositorOutputSurfaceSoftware* surfaceSoftware()
47 const OVERRIDE;
jamesr 2012/08/28 23:38:14 please do not OVERRIDE for implementations in chro
aelias_OOO_until_Jul13 2012/08/28 23:53:11 Removed OVERRIDE on my new method, should I also r
44 virtual void sendFrameToParentCompositor( 48 virtual void sendFrameToParentCompositor(
45 const WebKit::WebCompositorFrame&) OVERRIDE; 49 const WebKit::WebCompositorFrame&) OVERRIDE;
46 50
47 private: 51 private:
48 void OnMessageReceived(const IPC::Message& message); 52 void OnMessageReceived(const IPC::Message& message);
49 void OnUpdateVSyncParameters( 53 void OnUpdateVSyncParameters(
50 base::TimeTicks timebase, base::TimeDelta interval); 54 base::TimeTicks timebase, base::TimeDelta interval);
51 55
52 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_; 56 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_;
53 WebKit::WebCompositorOutputSurfaceClient* client_; 57 WebKit::WebCompositorOutputSurfaceClient* client_;
54 int routing_id_; 58 int routing_id_;
55 Capabilities capabilities_; 59 Capabilities capabilities_;
56 scoped_ptr<WebKit::WebGraphicsContext3D> context3D_; 60 scoped_ptr<WebKit::WebGraphicsContext3D> context3D_;
61 scoped_ptr<WebKit::WebCompositorOutputSurfaceSoftware> surfaceSoftware_;
piman 2012/08/28 23:26:59 nit: surface_software_
57 }; 62 };
58 63
59 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ 64 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_
60
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698