| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 class RenderWidgetHostImpl; | 48 class RenderWidgetHostImpl; |
| 49 class ResizeLock; | 49 class ResizeLock; |
| 50 | 50 |
| 51 // The DelegatedFrameHostClient is the interface from the DelegatedFrameHost, | 51 // The DelegatedFrameHostClient is the interface from the DelegatedFrameHost, |
| 52 // which manages delegated frames, and the ui::Compositor being used to | 52 // which manages delegated frames, and the ui::Compositor being used to |
| 53 // display them. | 53 // display them. |
| 54 class CONTENT_EXPORT DelegatedFrameHostClient { | 54 class CONTENT_EXPORT DelegatedFrameHostClient { |
| 55 public: | 55 public: |
| 56 virtual ui::Layer* DelegatedFrameHostGetLayer() const = 0; | 56 virtual ui::Layer* DelegatedFrameHostGetLayer() const = 0; |
| 57 virtual bool DelegatedFrameHostIsVisible() const = 0; | 57 virtual bool DelegatedFrameHostIsVisible() const = 0; |
| 58 |
| 59 // Returns the color that the resize gutters should be drawn with. Takes the |
| 60 // suggested color from the current page background. |
| 61 virtual SkColor DelegatedFrameHostGetGutterColor(SkColor color) const = 0; |
| 58 virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0; | 62 virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0; |
| 59 | 63 |
| 60 virtual bool DelegatedFrameCanCreateResizeLock() const = 0; | 64 virtual bool DelegatedFrameCanCreateResizeLock() const = 0; |
| 61 virtual scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( | 65 virtual scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( |
| 62 bool defer_compositor_lock) = 0; | 66 bool defer_compositor_lock) = 0; |
| 63 virtual void DelegatedFrameHostResizeLockWasReleased() = 0; | 67 virtual void DelegatedFrameHostResizeLockWasReleased() = 0; |
| 64 | 68 |
| 65 virtual void DelegatedFrameHostSendCompositorSwapAck( | 69 virtual void DelegatedFrameHostSendCompositorSwapAck( |
| 66 int output_surface_id, | 70 int output_surface_id, |
| 67 const cc::CompositorFrameAck& ack) = 0; | 71 const cc::CompositorFrameAck& ack) = 0; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 199 |
| 196 bool ShouldSkipFrame(gfx::Size size_in_dip) const; | 200 bool ShouldSkipFrame(gfx::Size size_in_dip) const; |
| 197 | 201 |
| 198 // Lazily grab a resize lock if the aura window size doesn't match the current | 202 // Lazily grab a resize lock if the aura window size doesn't match the current |
| 199 // frame size, to give time to the renderer. | 203 // frame size, to give time to the renderer. |
| 200 void MaybeCreateResizeLock(); | 204 void MaybeCreateResizeLock(); |
| 201 | 205 |
| 202 // Checks if the resize lock can be released because we received an new frame. | 206 // Checks if the resize lock can be released because we received an new frame. |
| 203 void CheckResizeLock(); | 207 void CheckResizeLock(); |
| 204 | 208 |
| 209 SkColor GetGutterColor() const; |
| 210 |
| 205 // Update the layers for the resize gutters to the right and bottom of the | 211 // Update the layers for the resize gutters to the right and bottom of the |
| 206 // surface layer. | 212 // surface layer. |
| 207 void UpdateGutters(); | 213 void UpdateGutters(); |
| 208 | 214 |
| 209 // Called after async thumbnailer task completes. Scales and crops the result | 215 // Called after async thumbnailer task completes. Scales and crops the result |
| 210 // of the copy. | 216 // of the copy. |
| 211 static void CopyFromCompositingSurfaceHasResultForVideo( | 217 static void CopyFromCompositingSurfaceHasResultForVideo( |
| 212 base::WeakPtr<DelegatedFrameHost> rwhva, | 218 base::WeakPtr<DelegatedFrameHost> rwhva, |
| 213 scoped_refptr<OwnedMailbox> subscriber_texture, | 219 scoped_refptr<OwnedMailbox> subscriber_texture, |
| 214 scoped_refptr<media::VideoFrame> video_frame, | 220 scoped_refptr<media::VideoFrame> video_frame, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 scoped_ptr<content::ReadbackYUVInterface> yuv_readback_pipeline_; | 321 scoped_ptr<content::ReadbackYUVInterface> yuv_readback_pipeline_; |
| 316 | 322 |
| 317 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 323 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 318 | 324 |
| 319 cc::BeginFrameSource* begin_frame_source_; | 325 cc::BeginFrameSource* begin_frame_source_; |
| 320 }; | 326 }; |
| 321 | 327 |
| 322 } // namespace content | 328 } // namespace content |
| 323 | 329 |
| 324 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 330 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |