| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 class RenderWidgetHostImpl; | 51 class RenderWidgetHostImpl; |
| 52 class ResizeLock; | 52 class ResizeLock; |
| 53 | 53 |
| 54 // The DelegatedFrameHostClient is the interface from the DelegatedFrameHost, | 54 // The DelegatedFrameHostClient is the interface from the DelegatedFrameHost, |
| 55 // which manages delegated frames, and the ui::Compositor being used to | 55 // which manages delegated frames, and the ui::Compositor being used to |
| 56 // display them. | 56 // display them. |
| 57 class CONTENT_EXPORT DelegatedFrameHostClient { | 57 class CONTENT_EXPORT DelegatedFrameHostClient { |
| 58 public: | 58 public: |
| 59 virtual ui::Layer* DelegatedFrameHostGetLayer() const = 0; | 59 virtual ui::Layer* DelegatedFrameHostGetLayer() const = 0; |
| 60 virtual bool DelegatedFrameHostIsVisible() const = 0; | 60 virtual bool DelegatedFrameHostIsVisible() const = 0; |
| 61 |
| 62 // Returns the color that the resize gutters should be drawn with. Takes the |
| 63 // suggested color from the current page background. |
| 64 virtual SkColor DelegatedFrameHostGetGutterColor(SkColor color) const = 0; |
| 61 virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0; | 65 virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0; |
| 62 | 66 |
| 63 virtual bool DelegatedFrameCanCreateResizeLock() const = 0; | 67 virtual bool DelegatedFrameCanCreateResizeLock() const = 0; |
| 64 virtual std::unique_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( | 68 virtual std::unique_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( |
| 65 bool defer_compositor_lock) = 0; | 69 bool defer_compositor_lock) = 0; |
| 66 virtual void DelegatedFrameHostResizeLockWasReleased() = 0; | 70 virtual void DelegatedFrameHostResizeLockWasReleased() = 0; |
| 67 | 71 |
| 68 virtual void DelegatedFrameHostSendCompositorSwapAck( | 72 virtual void DelegatedFrameHostSendCompositorSwapAck( |
| 69 int output_surface_id, | 73 int output_surface_id, |
| 70 const cc::CompositorFrameAck& ack) = 0; | 74 const cc::CompositorFrameAck& ack) = 0; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 204 |
| 201 bool ShouldSkipFrame(gfx::Size size_in_dip) const; | 205 bool ShouldSkipFrame(gfx::Size size_in_dip) const; |
| 202 | 206 |
| 203 // Lazily grab a resize lock if the aura window size doesn't match the current | 207 // Lazily grab a resize lock if the aura window size doesn't match the current |
| 204 // frame size, to give time to the renderer. | 208 // frame size, to give time to the renderer. |
| 205 void MaybeCreateResizeLock(); | 209 void MaybeCreateResizeLock(); |
| 206 | 210 |
| 207 // Checks if the resize lock can be released because we received an new frame. | 211 // Checks if the resize lock can be released because we received an new frame. |
| 208 void CheckResizeLock(); | 212 void CheckResizeLock(); |
| 209 | 213 |
| 214 SkColor GetGutterColor() const; |
| 215 |
| 210 // Update the layers for the resize gutters to the right and bottom of the | 216 // Update the layers for the resize gutters to the right and bottom of the |
| 211 // surface layer. | 217 // surface layer. |
| 212 void UpdateGutters(); | 218 void UpdateGutters(); |
| 213 | 219 |
| 214 // Called after async thumbnailer task completes. Scales and crops the result | 220 // Called after async thumbnailer task completes. Scales and crops the result |
| 215 // of the copy. | 221 // of the copy. |
| 216 static void CopyFromCompositingSurfaceHasResultForVideo( | 222 static void CopyFromCompositingSurfaceHasResultForVideo( |
| 217 base::WeakPtr<DelegatedFrameHost> rwhva, | 223 base::WeakPtr<DelegatedFrameHost> rwhva, |
| 218 scoped_refptr<OwnedMailbox> subscriber_texture, | 224 scoped_refptr<OwnedMailbox> subscriber_texture, |
| 219 scoped_refptr<media::VideoFrame> video_frame, | 225 scoped_refptr<media::VideoFrame> video_frame, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // YUV readback pipeline. | 326 // YUV readback pipeline. |
| 321 std::unique_ptr<display_compositor::ReadbackYUVInterface> | 327 std::unique_ptr<display_compositor::ReadbackYUVInterface> |
| 322 yuv_readback_pipeline_; | 328 yuv_readback_pipeline_; |
| 323 | 329 |
| 324 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 330 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 325 }; | 331 }; |
| 326 | 332 |
| 327 } // namespace content | 333 } // namespace content |
| 328 | 334 |
| 329 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 335 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |