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

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

Issue 511253003: Made Blink aware of top controls offset (Chromium-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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) 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_GPU_RENDER_WIDGET_COMPOSITOR_H_ 5 #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_
6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 virtual ~RenderWidgetCompositor(); 44 virtual ~RenderWidgetCompositor();
45 45
46 const base::WeakPtr<cc::InputHandler>& GetInputHandler(); 46 const base::WeakPtr<cc::InputHandler>& GetInputHandler();
47 bool BeginMainFrameRequested() const; 47 bool BeginMainFrameRequested() const;
48 void SetNeedsDisplayOnAllLayers(); 48 void SetNeedsDisplayOnAllLayers();
49 void SetRasterizeOnlyVisibleContent(); 49 void SetRasterizeOnlyVisibleContent();
50 void UpdateTopControlsState(cc::TopControlsState constraints, 50 void UpdateTopControlsState(cc::TopControlsState constraints,
51 cc::TopControlsState current, 51 cc::TopControlsState current,
52 bool animate); 52 bool animate);
53 void SetTopControlsLayoutHeight(float top_controls_layout_height);
54 void SetNeedsRedrawRect(gfx::Rect damage_rect); 53 void SetNeedsRedrawRect(gfx::Rect damage_rect);
55 // Like setNeedsRedraw but forces the frame to be drawn, without early-outs. 54 // Like setNeedsRedraw but forces the frame to be drawn, without early-outs.
56 // Redraw will be forced after the next commit 55 // Redraw will be forced after the next commit
57 void SetNeedsForcedRedraw(); 56 void SetNeedsForcedRedraw();
58 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped 57 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped
59 // LatencyInfoSwapPromiseMonitor. During the life time of the 58 // LatencyInfoSwapPromiseMonitor. During the life time of the
60 // LatencyInfoSwapPromiseMonitor, if SetNeedsCommit() or SetNeedsUpdateLayer() 59 // LatencyInfoSwapPromiseMonitor, if SetNeedsCommit() or SetNeedsUpdateLayer()
61 // is called on LayerTreeHost, the original latency info will be turned 60 // is called on LayerTreeHost, the original latency info will be turned
62 // into a LatencyInfoSwapPromise. 61 // into a LatencyInfoSwapPromise.
63 scoped_ptr<cc::SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( 62 scoped_ptr<cc::SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor(
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const blink::WebLayer* outerViewportScrollLayer) OVERRIDE; 115 const blink::WebLayer* outerViewportScrollLayer) OVERRIDE;
117 virtual void clearViewportLayers() OVERRIDE; 116 virtual void clearViewportLayers() OVERRIDE;
118 virtual void registerSelection(const blink::WebSelectionBound& start, 117 virtual void registerSelection(const blink::WebSelectionBound& start,
119 const blink::WebSelectionBound& end) OVERRIDE; 118 const blink::WebSelectionBound& end) OVERRIDE;
120 virtual void clearSelection() OVERRIDE; 119 virtual void clearSelection() OVERRIDE;
121 virtual void setShowFPSCounter(bool show); 120 virtual void setShowFPSCounter(bool show);
122 virtual void setShowPaintRects(bool show); 121 virtual void setShowPaintRects(bool show);
123 virtual void setShowDebugBorders(bool show); 122 virtual void setShowDebugBorders(bool show);
124 virtual void setContinuousPaintingEnabled(bool enabled); 123 virtual void setContinuousPaintingEnabled(bool enabled);
125 virtual void setShowScrollBottleneckRects(bool show); 124 virtual void setShowScrollBottleneckRects(bool show);
125 virtual void setTopControlsContentOffset(int);
bokan 2014/08/28 18:42:45 It feels strange that this class ends up with two
aelias_OOO_until_Jul13 2014/08/29 04:37:01 Could you instead add an additional parameter to a
bokan 2014/08/29 18:02:14 I had a FIXME to do just that. My concern was that
bokan 2014/09/02 18:57:16 Done.
126 126
127 // cc::LayerTreeHostClient implementation. 127 // cc::LayerTreeHostClient implementation.
128 virtual void WillBeginMainFrame(int frame_id) OVERRIDE; 128 virtual void WillBeginMainFrame(int frame_id) OVERRIDE;
129 virtual void DidBeginMainFrame() OVERRIDE; 129 virtual void DidBeginMainFrame() OVERRIDE;
130 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) OVERRIDE; 130 virtual void BeginMainFrame(const cc::BeginFrameArgs& args) OVERRIDE;
131 virtual void Layout() OVERRIDE; 131 virtual void Layout() OVERRIDE;
132 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, 132 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta,
133 float page_scale) OVERRIDE; 133 float page_scale) OVERRIDE;
134 virtual void SetTopControlsContentOffset(int offset) OVERRIDE;
134 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) 135 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback)
135 OVERRIDE; 136 OVERRIDE;
136 virtual void DidInitializeOutputSurface() OVERRIDE; 137 virtual void DidInitializeOutputSurface() OVERRIDE;
137 virtual void WillCommit() OVERRIDE; 138 virtual void WillCommit() OVERRIDE;
138 virtual void DidCommit() OVERRIDE; 139 virtual void DidCommit() OVERRIDE;
139 virtual void DidCommitAndDrawFrame() OVERRIDE; 140 virtual void DidCommitAndDrawFrame() OVERRIDE;
140 virtual void DidCompleteSwapBuffers() OVERRIDE; 141 virtual void DidCompleteSwapBuffers() OVERRIDE;
141 virtual void RateLimitSharedMainThreadContext() OVERRIDE; 142 virtual void RateLimitSharedMainThreadContext() OVERRIDE;
142 143
143 // cc::LayerTreeHostSingleThreadClient implementation. 144 // cc::LayerTreeHostSingleThreadClient implementation.
144 virtual void ScheduleAnimation() OVERRIDE; 145 virtual void ScheduleAnimation() OVERRIDE;
145 virtual void DidPostSwapBuffers() OVERRIDE; 146 virtual void DidPostSwapBuffers() OVERRIDE;
146 virtual void DidAbortSwapBuffers() OVERRIDE; 147 virtual void DidAbortSwapBuffers() OVERRIDE;
147 148
148 private: 149 private:
149 RenderWidgetCompositor(RenderWidget* widget, bool threaded); 150 RenderWidgetCompositor(RenderWidget* widget, bool threaded);
150 151
151 void Initialize(cc::LayerTreeSettings settings); 152 void Initialize(cc::LayerTreeSettings settings);
152 153
153 bool threaded_; 154 bool threaded_;
154 RenderWidget* widget_; 155 RenderWidget* widget_;
155 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; 156 scoped_ptr<cc::LayerTreeHost> layer_tree_host_;
156 }; 157 };
157 158
158 } // namespace content 159 } // namespace content
159 160
160 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ 161 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698