| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 26 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 27 #include "ui/gfx/size.h" | 27 #include "ui/gfx/size.h" |
| 28 #include "ui/gfx/vector2d_f.h" | 28 #include "ui/gfx/vector2d_f.h" |
| 29 | 29 |
| 30 struct ViewHostMsg_TextInputState_Params; | 30 struct ViewHostMsg_TextInputState_Params; |
| 31 | 31 |
| 32 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 32 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
| 33 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; | 33 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; |
| 34 | 34 |
| 35 namespace cc { | 35 namespace cc { |
| 36 class CopyOutputResult; |
| 36 class DelegatedRendererLayer; | 37 class DelegatedRendererLayer; |
| 37 class Layer; | 38 class Layer; |
| 38 class TextureLayer; | 39 class TextureLayer; |
| 39 } | 40 } |
| 40 | 41 |
| 41 namespace WebKit { | 42 namespace WebKit { |
| 42 class WebExternalTextureLayer; | 43 class WebExternalTextureLayer; |
| 43 class WebTouchEvent; | 44 class WebTouchEvent; |
| 44 class WebMouseEvent; | 45 class WebMouseEvent; |
| 45 } | 46 } |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 void RequestContentClipping(const gfx::Rect& clipping, | 226 void RequestContentClipping(const gfx::Rect& clipping, |
| 226 const gfx::Size& content_size); | 227 const gfx::Size& content_size); |
| 227 | 228 |
| 228 // Returns true when animation ticks are still needed. This avoids a separate | 229 // Returns true when animation ticks are still needed. This avoids a separate |
| 229 // round-trip for requesting follow-up animation. | 230 // round-trip for requesting follow-up animation. |
| 230 bool Animate(base::TimeTicks frame_time); | 231 bool Animate(base::TimeTicks frame_time); |
| 231 | 232 |
| 232 void SynchronousFrameMetadata( | 233 void SynchronousFrameMetadata( |
| 233 const cc::CompositorFrameMetadata& frame_metadata); | 234 const cc::CompositorFrameMetadata& frame_metadata); |
| 234 | 235 |
| 236 bool CanCopyToBitmap() const; |
| 237 |
| 235 private: | 238 private: |
| 236 void BuffersSwapped(const gpu::Mailbox& mailbox, | 239 void BuffersSwapped(const gpu::Mailbox& mailbox, |
| 237 uint32_t output_surface_id, | 240 uint32_t output_surface_id, |
| 238 const base::Closure& ack_callback); | 241 const base::Closure& ack_callback); |
| 239 | 242 |
| 240 void RunAckCallbacks(); | 243 void RunAckCallbacks(); |
| 241 | 244 |
| 242 void SwapDelegatedFrame(uint32 output_surface_id, | 245 void SwapDelegatedFrame(uint32 output_surface_id, |
| 243 scoped_ptr<cc::DelegatedFrameData> frame_data); | 246 scoped_ptr<cc::DelegatedFrameData> frame_data); |
| 244 void SendDelegatedFrameAck(uint32 output_surface_id); | 247 void SendDelegatedFrameAck(uint32 output_surface_id); |
| 245 | 248 |
| 246 void UpdateContentViewCoreFrameMetadata( | 249 void UpdateContentViewCoreFrameMetadata( |
| 247 const cc::CompositorFrameMetadata& frame_metadata); | 250 const cc::CompositorFrameMetadata& frame_metadata); |
| 248 void ComputeContentsSize(const cc::CompositorFrameMetadata& frame_metadata); | 251 void ComputeContentsSize(const cc::CompositorFrameMetadata& frame_metadata); |
| 249 void ResetClipping(); | 252 void ResetClipping(); |
| 250 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); | 253 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); |
| 251 | 254 |
| 252 void AttachLayers(); | 255 void AttachLayers(); |
| 253 void RemoveLayers(); | 256 void RemoveLayers(); |
| 254 | 257 |
| 255 void CreateOverscrollEffectIfNecessary(); | 258 void CreateOverscrollEffectIfNecessary(); |
| 256 void UpdateAnimationSize(const cc::CompositorFrameMetadata& frame_metadata); | 259 void UpdateAnimationSize(const cc::CompositorFrameMetadata& frame_metadata); |
| 257 void ScheduleAnimationIfNecessary(); | 260 void ScheduleAnimationIfNecessary(); |
| 258 | 261 |
| 262 // Called after async thumbnailer task completes. Scales and crops the result |
| 263 // of the copy. |
| 264 static void CopyFromCompositingSurfaceHasResult( |
| 265 const gfx::Size& dst_size_in_pixel, |
| 266 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 267 scoped_ptr<cc::CopyOutputResult> result); |
| 268 static void PrepareTextureCopyOutputResult( |
| 269 const gfx::Size& dst_size_in_pixel, |
| 270 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 271 scoped_ptr<cc::CopyOutputResult> result); |
| 272 static void PrepareBitmapCopyOutputResult( |
| 273 const gfx::Size& dst_size_in_pixel, |
| 274 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 275 scoped_ptr<cc::CopyOutputResult> result); |
| 276 |
| 259 // The model object. | 277 // The model object. |
| 260 RenderWidgetHostImpl* host_; | 278 RenderWidgetHostImpl* host_; |
| 261 | 279 |
| 262 // Used to track whether this render widget needs a BeginFrame. | 280 // Used to track whether this render widget needs a BeginFrame. |
| 263 bool needs_begin_frame_; | 281 bool needs_begin_frame_; |
| 264 | 282 |
| 265 // Whether or not this widget is potentially attached to the view hierarchy. | 283 // Whether or not this widget is potentially attached to the view hierarchy. |
| 266 // This view may not actually be attached if this is true, but it should be | 284 // This view may not actually be attached if this is true, but it should be |
| 267 // treated as such, because as soon as a ContentViewCore is set the layer | 285 // treated as such, because as soon as a ContentViewCore is set the layer |
| 268 // will be attached automatically. | 286 // will be attached automatically. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 // Used to render overscroll overlays. | 327 // Used to render overscroll overlays. |
| 310 bool overscroll_effect_enabled_; | 328 bool overscroll_effect_enabled_; |
| 311 scoped_ptr<OverscrollGlow> overscroll_effect_; | 329 scoped_ptr<OverscrollGlow> overscroll_effect_; |
| 312 | 330 |
| 313 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 331 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
| 314 }; | 332 }; |
| 315 | 333 |
| 316 } // namespace content | 334 } // namespace content |
| 317 | 335 |
| 318 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 336 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
| OLD | NEW |