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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_output_surface.h

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing doc Created 6 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE _H_ 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE _H_
6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE _H_ 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_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"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "cc/output/managed_memory_policy.h" 12 #include "cc/output/managed_memory_policy.h"
13 #include "cc/output/output_surface.h" 13 #include "cc/output/output_surface.h"
14 #include "content/public/browser/android/synchronous_compositor.h" 14 #include "content/public/browser/android/synchronous_compositor.h"
15 #include "ui/gfx/transform.h" 15 #include "ui/gfx/transform.h"
16 16
17 namespace cc { 17 namespace cc {
18 class ContextProvider; 18 class ContextProvider;
19 class CompositorFrameMetadata; 19 class CompositorFrameMetadata;
20 } 20 }
21 21
22 namespace content { 22 namespace content {
23 23
24 class FrameSwapMessageQueue;
24 class SynchronousCompositorClient; 25 class SynchronousCompositorClient;
25 class SynchronousCompositorOutputSurface; 26 class SynchronousCompositorOutputSurface;
26 class WebGraphicsContext3DCommandBufferImpl; 27 class WebGraphicsContext3DCommandBufferImpl;
27 28
28 class SynchronousCompositorOutputSurfaceDelegate { 29 class SynchronousCompositorOutputSurfaceDelegate {
29 public: 30 public:
30 virtual void DidBindOutputSurface( 31 virtual void DidBindOutputSurface(
31 SynchronousCompositorOutputSurface* output_surface) = 0; 32 SynchronousCompositorOutputSurface* output_surface) = 0;
32 virtual void DidDestroySynchronousOutputSurface( 33 virtual void DidDestroySynchronousOutputSurface(
33 SynchronousCompositorOutputSurface* output_surface) = 0; 34 SynchronousCompositorOutputSurface* output_surface) = 0;
(...skipping 11 matching lines...) Expand all
45 // content::SynchronousCompositor public API. This class effects an "inversion 46 // content::SynchronousCompositor public API. This class effects an "inversion
46 // of control" - enabling drawing to be orchestrated by the embedding 47 // of control" - enabling drawing to be orchestrated by the embedding
47 // layer, instead of driven by the compositor internals - hence it holds two 48 // layer, instead of driven by the compositor internals - hence it holds two
48 // 'client' pointers (|client_| in the OutputSurface baseclass and 49 // 'client' pointers (|client_| in the OutputSurface baseclass and
49 // GetDelegate()) which represent the consumers of the two roles in plays. 50 // GetDelegate()) which represent the consumers of the two roles in plays.
50 // This class can be created only on the main thread, but then becomes pinned 51 // This class can be created only on the main thread, but then becomes pinned
51 // to a fixed thread when BindToClient is called. 52 // to a fixed thread when BindToClient is called.
52 class SynchronousCompositorOutputSurface 53 class SynchronousCompositorOutputSurface
53 : NON_EXPORTED_BASE(public cc::OutputSurface) { 54 : NON_EXPORTED_BASE(public cc::OutputSurface) {
54 public: 55 public:
55 explicit SynchronousCompositorOutputSurface(int routing_id); 56 explicit SynchronousCompositorOutputSurface(
57 int routing_id,
58 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue);
56 virtual ~SynchronousCompositorOutputSurface(); 59 virtual ~SynchronousCompositorOutputSurface();
57 60
58 // OutputSurface. 61 // OutputSurface.
59 virtual bool ForcedDrawToSoftwareDevice() const OVERRIDE; 62 virtual bool ForcedDrawToSoftwareDevice() const OVERRIDE;
60 virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE; 63 virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE;
61 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; 64 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE;
62 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; 65 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE;
63 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; 66 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE;
64 67
65 // Partial SynchronousCompositor API implementation. 68 // Partial SynchronousCompositor API implementation.
(...skipping 29 matching lines...) Expand all
95 gfx::Rect cached_hw_viewport_; 98 gfx::Rect cached_hw_viewport_;
96 gfx::Rect cached_hw_clip_; 99 gfx::Rect cached_hw_clip_;
97 100
98 // Only valid (non-NULL) during a DemandDrawSw() call. 101 // Only valid (non-NULL) during a DemandDrawSw() call.
99 SkCanvas* current_sw_canvas_; 102 SkCanvas* current_sw_canvas_;
100 103
101 cc::ManagedMemoryPolicy memory_policy_; 104 cc::ManagedMemoryPolicy memory_policy_;
102 105
103 cc::OutputSurfaceClient* output_surface_client_; 106 cc::OutputSurfaceClient* output_surface_client_;
104 107
108 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
109
105 base::WeakPtrFactory<SynchronousCompositorOutputSurface> weak_ptr_factory_; 110 base::WeakPtrFactory<SynchronousCompositorOutputSurface> weak_ptr_factory_;
106 111
107 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); 112 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface);
108 }; 113 };
109 114
110 } // namespace content 115 } // namespace content
111 116
112 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURF ACE_H_ 117 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURF ACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698