OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ |
| 6 #define CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/threading/non_thread_safe.h" |
| 13 #include "base/time.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutput
Surface.h" |
| 15 |
| 16 namespace base { |
| 17 class TaskRunner; |
| 18 } |
| 19 |
| 20 namespace IPC { |
| 21 class ForwardingMessageFilter; |
| 22 class Message; |
| 23 class SyncChannel; |
| 24 } |
| 25 |
| 26 // This class can be created only on the main thread, but then becomes pinned |
| 27 // to a fixed thread when bindToClient is called. |
| 28 class CompositorOutputSurface |
| 29 : NON_EXPORTED_BASE(public WebKit::WebCompositorOutputSurface) |
| 30 , NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 31 public: |
| 32 static IPC::ForwardingMessageFilter* CreateFilter( |
| 33 base::TaskRunner* target_task_runner); |
| 34 |
| 35 CompositorOutputSurface(int32 routing_id, |
| 36 WebKit::WebGraphicsContext3D* context3d); |
| 37 virtual ~CompositorOutputSurface(); |
| 38 |
| 39 // WebCompositorOutputSurface implementation. |
| 40 virtual bool bindToClient( |
| 41 WebKit::WebCompositorOutputSurfaceClient* client) OVERRIDE; |
| 42 virtual const Capabilities& capabilities() const OVERRIDE; |
| 43 virtual WebKit::WebGraphicsContext3D* context3D() const OVERRIDE; |
| 44 virtual void sendFrameToParentCompositor( |
| 45 const WebKit::WebCompositorFrame&) OVERRIDE; |
| 46 |
| 47 private: |
| 48 void OnMessageReceived(const IPC::Message& message); |
| 49 void OnUpdateVSyncParameters( |
| 50 base::TimeTicks timebase, base::TimeDelta interval); |
| 51 |
| 52 scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_; |
| 53 WebKit::WebCompositorOutputSurfaceClient* client_; |
| 54 int routing_id_; |
| 55 Capabilities capabilities_; |
| 56 scoped_ptr<WebKit::WebGraphicsContext3D> context3D_; |
| 57 }; |
| 58 |
| 59 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_OUTPUT_SURFACE_H_ |
| 60 |
OLD | NEW |