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

Side by Side Diff: content/renderer/android/synchronous_compositor_output_surface.h

Issue 14888002: Android WebView Merged-Thread Hardware Draw (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ 5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_RENDERER_ANDOIRD_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ 6 #define CONTENT_RENDERER_ANDOIRD_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/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 10 matching lines...) Expand all
21 // of control" - enabling drawing to be orchestrated by the embedding 21 // of control" - enabling drawing to be orchestrated by the embedding
22 // layer, instead of driven by the compositor internals - hence it holds two 22 // layer, instead of driven by the compositor internals - hence it holds two
23 // 'client' pointers (including |client_| in the OutputSurface baseclass) which 23 // 'client' pointers (including |client_| in the OutputSurface baseclass) which
24 // represent the consumers of the two roles in plays. 24 // represent the consumers of the two roles in plays.
25 // This class can be created only on the main thread, but then becomes pinned 25 // This class can be created only on the main thread, but then becomes pinned
26 // to a fixed thread when BindToClient is called. 26 // to a fixed thread when BindToClient is called.
27 class SynchronousCompositorOutputSurface 27 class SynchronousCompositorOutputSurface
28 : NON_EXPORTED_BASE(public cc::OutputSurface), 28 : NON_EXPORTED_BASE(public cc::OutputSurface),
29 NON_EXPORTED_BASE(public SynchronousCompositor) { 29 NON_EXPORTED_BASE(public SynchronousCompositor) {
30 public: 30 public:
31 SynchronousCompositorOutputSurface( 31 explicit SynchronousCompositorOutputSurface(int32 routing_id);
32 int32 routing_id,
33 WebGraphicsContext3DCommandBufferImpl* context);
34 virtual ~SynchronousCompositorOutputSurface(); 32 virtual ~SynchronousCompositorOutputSurface();
35 33
36 // OutputSurface. 34 // OutputSurface.
37 virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE; 35 virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE;
36 virtual void Reshape(gfx::Size size) OVERRIDE;
38 virtual void SendFrameToParentCompositor(cc::CompositorFrame* frame) OVERRIDE; 37 virtual void SendFrameToParentCompositor(cc::CompositorFrame* frame) OVERRIDE;
38 virtual void EnableVSyncNotification(bool enable_vsync) OVERRIDE;
39 virtual void SwapBuffers(const cc::LatencyInfo& info) OVERRIDE;
39 40
40 // SynchronousCompositor. 41 // SynchronousCompositor.
41 virtual void SetClient(SynchronousCompositorClient* compositor_client) 42 virtual void SetClient(SynchronousCompositorClient* compositor_client)
42 OVERRIDE; 43 OVERRIDE;
43 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; 44 virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE;
45 virtual bool DemandDrawHw(
46 gfx::Size view_size,
47 const gfx::Transform& transform,
48 gfx::Rect clip) OVERRIDE;
44 49
45 private: 50 private:
51 void UpdateCompositorClientSettings();
46 bool CalledOnValidThread() const; 52 bool CalledOnValidThread() const;
47 53
48 SynchronousCompositorClient* compositor_client_; 54 SynchronousCompositorClient* compositor_client_;
49 int routing_id_; 55 int routing_id_;
56 bool vsync_enabled_;
57 bool did_swap_buffer_;
50 58
51 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); 59 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface);
52 }; 60 };
53 61
54 } // namespace content 62 } // namespace content
55 63
56 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_ 64 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698