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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 void OnDidChangeBodyBackgroundColor(SkColor color); | 208 void OnDidChangeBodyBackgroundColor(SkColor color); |
208 void OnStartContentIntent(const GURL& content_url); | 209 void OnStartContentIntent(const GURL& content_url); |
209 void OnSetNeedsBeginFrame(bool enabled); | 210 void OnSetNeedsBeginFrame(bool enabled); |
210 | 211 |
211 int GetNativeImeAdapter(); | 212 int GetNativeImeAdapter(); |
212 | 213 |
213 void WasResized(); | 214 void WasResized(); |
214 | 215 |
215 WebKit::WebGLId GetScaledContentTexture(float scale, gfx::Size* out_size); | 216 WebKit::WebGLId GetScaledContentTexture(float scale, gfx::Size* out_size); |
216 bool PopulateBitmapWithContents(jobject jbitmap); | 217 bool PopulateBitmapWithContents(jobject jbitmap); |
| 218 bool PopulateBitmapWithContents(const gfx::Size& size, SkBitmap* bitmap); |
217 | 219 |
218 bool HasValidFrame() const; | 220 bool HasValidFrame() const; |
219 | 221 |
220 // Select all text between the given coordinates. | 222 // Select all text between the given coordinates. |
221 void SelectRange(const gfx::Point& start, const gfx::Point& end); | 223 void SelectRange(const gfx::Point& start, const gfx::Point& end); |
222 | 224 |
223 void MoveCaret(const gfx::Point& point); | 225 void MoveCaret(const gfx::Point& point); |
224 | 226 |
225 void RequestContentClipping(const gfx::Rect& clipping, | 227 void RequestContentClipping(const gfx::Rect& clipping, |
226 const gfx::Size& content_size); | 228 const gfx::Size& content_size); |
227 | 229 |
228 // Returns true when animation ticks are still needed. This avoids a separate | 230 // Returns true when animation ticks are still needed. This avoids a separate |
229 // round-trip for requesting follow-up animation. | 231 // round-trip for requesting follow-up animation. |
230 bool Animate(base::TimeTicks frame_time); | 232 bool Animate(base::TimeTicks frame_time); |
231 | 233 |
232 void SynchronousFrameMetadata( | 234 void SynchronousFrameMetadata( |
233 const cc::CompositorFrameMetadata& frame_metadata); | 235 const cc::CompositorFrameMetadata& frame_metadata); |
234 | 236 |
| 237 bool CanCopyToBitmap() const; |
| 238 |
235 private: | 239 private: |
236 void BuffersSwapped(const gpu::Mailbox& mailbox, | 240 void BuffersSwapped(const gpu::Mailbox& mailbox, |
237 uint32_t output_surface_id, | 241 uint32_t output_surface_id, |
238 const base::Closure& ack_callback); | 242 const base::Closure& ack_callback); |
239 | 243 |
240 void RunAckCallbacks(); | 244 void RunAckCallbacks(); |
241 | 245 |
242 void SwapDelegatedFrame(uint32 output_surface_id, | 246 void SwapDelegatedFrame(uint32 output_surface_id, |
243 scoped_ptr<cc::DelegatedFrameData> frame_data); | 247 scoped_ptr<cc::DelegatedFrameData> frame_data); |
244 void SendDelegatedFrameAck(uint32 output_surface_id); | 248 void SendDelegatedFrameAck(uint32 output_surface_id); |
245 | 249 |
246 void UpdateContentViewCoreFrameMetadata( | 250 void UpdateContentViewCoreFrameMetadata( |
247 const cc::CompositorFrameMetadata& frame_metadata); | 251 const cc::CompositorFrameMetadata& frame_metadata); |
248 void ComputeContentsSize(const cc::CompositorFrameMetadata& frame_metadata); | 252 void ComputeContentsSize(const cc::CompositorFrameMetadata& frame_metadata); |
249 void ResetClipping(); | 253 void ResetClipping(); |
250 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); | 254 void ClipContents(const gfx::Rect& clipping, const gfx::Size& content_size); |
251 | 255 |
252 void AttachLayers(); | 256 void AttachLayers(); |
253 void RemoveLayers(); | 257 void RemoveLayers(); |
254 | 258 |
255 void CreateOverscrollEffectIfNecessary(); | 259 void CreateOverscrollEffectIfNecessary(); |
256 void UpdateAnimationSize(const cc::CompositorFrameMetadata& frame_metadata); | 260 void UpdateAnimationSize(const cc::CompositorFrameMetadata& frame_metadata); |
257 void ScheduleAnimationIfNecessary(); | 261 void ScheduleAnimationIfNecessary(); |
258 | 262 |
| 263 // Called after async thumbnailer task completes. Scales and crops the result |
| 264 // of the copy. |
| 265 static void CopyFromCompositingSurfaceHasResult( |
| 266 const gfx::Size& dst_size_in_pixel, |
| 267 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 268 scoped_ptr<cc::CopyOutputResult> result); |
| 269 static void PrepareTextureCopyOutputResult( |
| 270 const gfx::Size& dst_size_in_pixel, |
| 271 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 272 scoped_ptr<cc::CopyOutputResult> result); |
| 273 static void PrepareBitmapCopyOutputResult( |
| 274 const gfx::Size& dst_size_in_pixel, |
| 275 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 276 scoped_ptr<cc::CopyOutputResult> result); |
| 277 |
259 // The model object. | 278 // The model object. |
260 RenderWidgetHostImpl* host_; | 279 RenderWidgetHostImpl* host_; |
261 | 280 |
262 // Used to track whether this render widget needs a BeginFrame. | 281 // Used to track whether this render widget needs a BeginFrame. |
263 bool needs_begin_frame_; | 282 bool needs_begin_frame_; |
264 | 283 |
265 // Whether or not this widget is potentially attached to the view hierarchy. | 284 // 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 | 285 // 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 | 286 // treated as such, because as soon as a ContentViewCore is set the layer |
268 // will be attached automatically. | 287 // will be attached automatically. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // Used to render overscroll overlays. | 328 // Used to render overscroll overlays. |
310 bool overscroll_effect_enabled_; | 329 bool overscroll_effect_enabled_; |
311 scoped_ptr<OverscrollGlow> overscroll_effect_; | 330 scoped_ptr<OverscrollGlow> overscroll_effect_; |
312 | 331 |
313 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); | 332 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
314 }; | 333 }; |
315 | 334 |
316 } // namespace content | 335 } // namespace content |
317 | 336 |
318 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ | 337 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ |
OLD | NEW |