Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 253913003: Remove RenderWidgetHostView*::DidUpdateBackingStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "content/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 NOTIFICATION_RENDER_WIDGET_HOST_DID_UPDATE_BACKING_STORE, 1598 NOTIFICATION_RENDER_WIDGET_HOST_DID_UPDATE_BACKING_STORE,
1599 Source<RenderWidgetHost>(this), 1599 Source<RenderWidgetHost>(this),
1600 NotificationService::NoDetails()); 1600 NotificationService::NoDetails());
1601 1601
1602 // We don't need to update the view if the view is hidden. We must do this 1602 // We don't need to update the view if the view is hidden. We must do this
1603 // early return after the ACK is sent, however, or the renderer will not send 1603 // early return after the ACK is sent, however, or the renderer will not send
1604 // us more data. 1604 // us more data.
1605 if (is_hidden_) 1605 if (is_hidden_)
1606 return; 1606 return;
1607 1607
1608 // Now paint the view. Watch out: it might be destroyed already.
1609 if (view_ && !is_accelerated_compositing_active_) {
1610
1611 std::vector<ui::LatencyInfo> latency_info;
1612 for (size_t i = 0; i < params.latency_info.size(); i++) {
1613 ui::LatencyInfo info = params.latency_info[i];
1614 AddLatencyInfoComponentIds(&info);
1615 latency_info.push_back(info);
1616 }
1617
1618 view_being_painted_ = true;
1619 view_->DidUpdateBackingStore(params.scroll_rect, params.scroll_delta,
1620 params.copy_rects, latency_info);
1621 view_->DidReceiveRendererFrame();
1622 view_being_painted_ = false;
1623 }
1624
1625 // If we got a resize ack, then perhaps we have another resize to send? 1608 // If we got a resize ack, then perhaps we have another resize to send?
1626 bool is_resize_ack = 1609 bool is_resize_ack =
1627 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags); 1610 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags);
1628 if (is_resize_ack) 1611 if (is_resize_ack)
1629 WasResized(); 1612 WasResized();
1630 1613
1631 // Log the time delta for processing a paint message. 1614 // Log the time delta for processing a paint message.
1632 TimeTicks now = TimeTicks::Now(); 1615 TimeTicks now = TimeTicks::Now();
1633 TimeDelta delta = now - update_start; 1616 TimeDelta delta = now - update_start;
1634 UMA_HISTOGRAM_TIMES("MPArch.RWH_DidUpdateBackingStore", delta); 1617 UMA_HISTOGRAM_TIMES("MPArch.RWH_DidUpdateBackingStore", delta);
1635
1636 // Measures the time from receiving the MsgUpdateRect IPC to completing the
1637 // DidUpdateBackingStore() method. On platforms which have asynchronous
1638 // painting, such as Linux, this is the sum of MPArch.RWH_OnMsgUpdateRect,
1639 // MPArch.RWH_DidUpdateBackingStore, and the time spent asynchronously
1640 // waiting for the paint to complete.
1641 //
1642 // On other platforms, this will be equivalent to MPArch.RWH_OnMsgUpdateRect.
1643 delta = now - paint_start;
1644 UMA_HISTOGRAM_TIMES("MPArch.RWH_TotalPaintTime", delta);
1645 } 1618 }
1646 1619
1647 void RenderWidgetHostImpl::OnQueueSyntheticGesture( 1620 void RenderWidgetHostImpl::OnQueueSyntheticGesture(
1648 const SyntheticGesturePacket& gesture_packet) { 1621 const SyntheticGesturePacket& gesture_packet) {
1649 // Only allow untrustworthy gestures if explicitly enabled. 1622 // Only allow untrustworthy gestures if explicitly enabled.
1650 if (!CommandLine::ForCurrentProcess()->HasSwitch( 1623 if (!CommandLine::ForCurrentProcess()->HasSwitch(
1651 cc::switches::kEnableGpuBenchmarking)) { 1624 cc::switches::kEnableGpuBenchmarking)) {
1652 RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH7")); 1625 RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH7"));
1653 GetProcess()->ReceivedBadMessage(); 1626 GetProcess()->ReceivedBadMessage();
1654 return; 1627 return;
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 } 2327 }
2355 } 2328 }
2356 2329
2357 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { 2330 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() {
2358 if (view_) 2331 if (view_)
2359 return view_->PreferredReadbackFormat(); 2332 return view_->PreferredReadbackFormat();
2360 return SkBitmap::kARGB_8888_Config; 2333 return SkBitmap::kARGB_8888_Config;
2361 } 2334 }
2362 2335
2363 } // namespace content 2336 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698