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

Side by Side Diff: content/public/browser/android/synchronous_compositor.h

Issue 1769913003: sync compositor: Add output_surface_id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittests compile Created 4 years, 9 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 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_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 29 matching lines...) Expand all
40 class CONTENT_EXPORT SynchronousCompositor { 40 class CONTENT_EXPORT SynchronousCompositor {
41 public: 41 public:
42 // Must be called once per WebContents instance. Will create the compositor 42 // Must be called once per WebContents instance. Will create the compositor
43 // instance as needed, but only if |client| is non-nullptr. 43 // instance as needed, but only if |client| is non-nullptr.
44 static void SetClientForWebContents(WebContents* contents, 44 static void SetClientForWebContents(WebContents* contents,
45 SynchronousCompositorClient* client); 45 SynchronousCompositorClient* client);
46 46
47 static void SetGpuService( 47 static void SetGpuService(
48 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); 48 scoped_refptr<gpu::InProcessCommandBuffer::Service> service);
49 49
50 struct Frame {
51 uint32_t output_surface_id;
52 scoped_ptr<cc::CompositorFrame> frame;
53 };
54
50 // "On demand" hardware draw. The content is first clipped to |damage_area|, 55 // "On demand" hardware draw. The content is first clipped to |damage_area|,
51 // then transformed through |transform|, and finally clipped to |view_size|. 56 // then transformed through |transform|, and finally clipped to |view_size|.
52 virtual scoped_ptr<cc::CompositorFrame> DemandDrawHw( 57 virtual Frame DemandDrawHw(
53 const gfx::Size& surface_size, 58 const gfx::Size& surface_size,
54 const gfx::Transform& transform, 59 const gfx::Transform& transform,
55 const gfx::Rect& viewport, 60 const gfx::Rect& viewport,
56 const gfx::Rect& clip, 61 const gfx::Rect& clip,
57 const gfx::Rect& viewport_rect_for_tile_priority, 62 const gfx::Rect& viewport_rect_for_tile_priority,
58 const gfx::Transform& transform_for_tile_priority) = 0; 63 const gfx::Transform& transform_for_tile_priority) = 0;
59 64
60 // For delegated rendering, return resources from parent compositor to this. 65 // For delegated rendering, return resources from parent compositor to this.
61 // Note that all resources must be returned before ReleaseHwDraw. 66 // Note that all resources must be returned before ReleaseHwDraw.
62 virtual void ReturnResources(const cc::CompositorFrameAck& frame_ack) = 0; 67 virtual void ReturnResources(uint32_t output_surface_id,
68 const cc::CompositorFrameAck& frame_ack) = 0;
63 69
64 // "On demand" SW draw, into the supplied canvas (observing the transform 70 // "On demand" SW draw, into the supplied canvas (observing the transform
65 // and clip set there-in). 71 // and clip set there-in).
66 virtual bool DemandDrawSw(SkCanvas* canvas) = 0; 72 virtual bool DemandDrawSw(SkCanvas* canvas) = 0;
67 73
68 // Set the memory limit policy of this compositor. 74 // Set the memory limit policy of this compositor.
69 virtual void SetMemoryPolicy(size_t bytes_limit) = 0; 75 virtual void SetMemoryPolicy(size_t bytes_limit) = 0;
70 76
71 // Should be called by the embedder after the embedder had modified the 77 // Should be called by the embedder after the embedder had modified the
72 // scroll offset of the root layer. 78 // scroll offset of the root layer.
73 virtual void DidChangeRootLayerScrollOffset( 79 virtual void DidChangeRootLayerScrollOffset(
74 const gfx::ScrollOffset& root_offset) = 0; 80 const gfx::ScrollOffset& root_offset) = 0;
75 81
76 // Called by the embedder to notify that the compositor is active. The 82 // Called by the embedder to notify that the compositor is active. The
77 // compositor won't ask for vsyncs when it's inactive. NOTE: The compositor 83 // compositor won't ask for vsyncs when it's inactive. NOTE: The compositor
78 // starts off as inactive and needs a SetActive(true) call to begin. 84 // starts off as inactive and needs a SetActive(true) call to begin.
79 virtual void SetIsActive(bool is_active) = 0; 85 virtual void SetIsActive(bool is_active) = 0;
80 86
81 // Called by the embedder to notify that the OnComputeScroll step is happening 87 // Called by the embedder to notify that the OnComputeScroll step is happening
82 // and if any input animation is active, it should tick now. 88 // and if any input animation is active, it should tick now.
83 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0; 89 virtual void OnComputeScroll(base::TimeTicks animation_time) = 0;
84 90
85 protected: 91 protected:
86 virtual ~SynchronousCompositor() {} 92 virtual ~SynchronousCompositor() {}
87 }; 93 };
88 94
89 } // namespace content 95 } // namespace content
90 96
91 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ 97 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698