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 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... | |
38 | 38 |
39 namespace content { | 39 namespace content { |
40 | 40 |
41 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( | 41 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( |
42 RenderWidgetHost* widget_host) | 42 RenderWidgetHost* widget_host) |
43 : host_(RenderWidgetHostImpl::From(widget_host)), | 43 : host_(RenderWidgetHostImpl::From(widget_host)), |
44 next_surface_sequence_(1u), | 44 next_surface_sequence_(1u), |
45 last_output_surface_id_(0), | 45 last_output_surface_id_(0), |
46 current_surface_scale_factor_(1.f), | 46 current_surface_scale_factor_(1.f), |
47 ack_pending_count_(0), | 47 ack_pending_count_(0), |
48 frame_count_(0), | |
48 frame_connector_(nullptr), | 49 frame_connector_(nullptr), |
49 begin_frame_source_(nullptr), | 50 begin_frame_source_(nullptr), |
50 observing_begin_frame_source_(false), | 51 observing_begin_frame_source_(false), |
51 parent_surface_id_namespace_(0), | 52 parent_surface_id_namespace_(0), |
52 weak_factory_(this) { | 53 weak_factory_(this) { |
53 id_allocator_ = CreateSurfaceIdAllocator(); | 54 id_allocator_ = CreateSurfaceIdAllocator(); |
54 RegisterSurfaceNamespaceId(); | 55 RegisterSurfaceNamespaceId(); |
55 | 56 |
56 host_->SetView(this); | 57 host_->SetView(this); |
57 } | 58 } |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 // forward GestureScrollUpdate. | 346 // forward GestureScrollUpdate. |
346 if (frame_connector_ && | 347 if (frame_connector_ && |
347 event.type == blink::WebInputEvent::GestureScrollUpdate && not_consumed) | 348 event.type == blink::WebInputEvent::GestureScrollUpdate && not_consumed) |
348 frame_connector_->BubbleScrollEvent(event); | 349 frame_connector_->BubbleScrollEvent(event); |
349 } | 350 } |
350 | 351 |
351 void RenderWidgetHostViewChildFrame::SurfaceDrawn(uint32_t output_surface_id, | 352 void RenderWidgetHostViewChildFrame::SurfaceDrawn(uint32_t output_surface_id, |
352 cc::SurfaceDrawStatus drawn) { | 353 cc::SurfaceDrawStatus drawn) { |
353 cc::CompositorFrameAck ack; | 354 cc::CompositorFrameAck ack; |
354 DCHECK_GT(ack_pending_count_, 0U); | 355 DCHECK_GT(ack_pending_count_, 0U); |
356 | |
357 frame_count_++; | |
kenrb
2016/07/05 14:30:56
Should this be reset to zero when a new surface is
wjmaclean
2016/07/05 15:04:22
Done.
| |
358 | |
355 if (!surface_returned_resources_.empty()) | 359 if (!surface_returned_resources_.empty()) |
356 ack.resources.swap(surface_returned_resources_); | 360 ack.resources.swap(surface_returned_resources_); |
357 if (host_) { | 361 if (host_) { |
358 host_->Send(new ViewMsg_SwapCompositorFrameAck(host_->GetRoutingID(), | 362 host_->Send(new ViewMsg_SwapCompositorFrameAck(host_->GetRoutingID(), |
359 output_surface_id, ack)); | 363 output_surface_id, ack)); |
360 } | 364 } |
361 ack_pending_count_--; | 365 ack_pending_count_--; |
362 } | 366 } |
363 | 367 |
364 void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame( | 368 void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame( |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
688 | 692 |
689 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { | 693 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { |
690 return true; | 694 return true; |
691 } | 695 } |
692 | 696 |
693 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 697 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
694 return surface_id_; | 698 return surface_id_; |
695 }; | 699 }; |
696 | 700 |
697 } // namespace content | 701 } // namespace content |
OLD | NEW |