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

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

Issue 15682010: Support plumbing LatencyInfo through the old software path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 1021
1022 void RenderWidgetHostViewAura::ImeCompositionRangeChanged( 1022 void RenderWidgetHostViewAura::ImeCompositionRangeChanged(
1023 const ui::Range& range, 1023 const ui::Range& range,
1024 const std::vector<gfx::Rect>& character_bounds) { 1024 const std::vector<gfx::Rect>& character_bounds) {
1025 composition_character_bounds_ = character_bounds; 1025 composition_character_bounds_ = character_bounds;
1026 } 1026 }
1027 1027
1028 void RenderWidgetHostViewAura::DidUpdateBackingStore( 1028 void RenderWidgetHostViewAura::DidUpdateBackingStore(
1029 const gfx::Rect& scroll_rect, 1029 const gfx::Rect& scroll_rect,
1030 const gfx::Vector2d& scroll_delta, 1030 const gfx::Vector2d& scroll_delta,
1031 const std::vector<gfx::Rect>& copy_rects) { 1031 const std::vector<gfx::Rect>& copy_rects,
1032 const ui::LatencyInfo& latency_info) {
1032 if (accelerated_compositing_state_changed_) 1033 if (accelerated_compositing_state_changed_)
1033 UpdateExternalTexture(); 1034 UpdateExternalTexture();
1034 1035
1036 software_latency_info_.MergeWith(latency_info);
piman 2013/06/07 02:51:30 Does this grow arbitrarily? If the tab is updating
jbauman 2013/06/07 07:28:24 No, this structure was designed not to grow, for t
1037
1035 // Use the state of the RenderWidgetHost and not the window as the two may 1038 // Use the state of the RenderWidgetHost and not the window as the two may
1036 // differ. In particular if the window is hidden but the renderer isn't and we 1039 // differ. In particular if the window is hidden but the renderer isn't and we
1037 // ignore the update and the window is made visible again the layer isn't 1040 // ignore the update and the window is made visible again the layer isn't
1038 // marked as dirty and we show the wrong thing. 1041 // marked as dirty and we show the wrong thing.
1039 // We do this after UpdateExternalTexture() so that when we become visible 1042 // We do this after UpdateExternalTexture() so that when we become visible
1040 // we're not drawing a stale texture. 1043 // we're not drawing a stale texture.
1041 if (host_->is_hidden()) 1044 if (host_->is_hidden())
1042 return; 1045 return;
1043 1046
1044 gfx::Rect clip_rect; 1047 gfx::Rect clip_rect;
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 paint_observer_->OnPaintComplete(); 2226 paint_observer_->OnPaintComplete();
2224 } else if (!is_compositing_active && has_backing_store) { 2227 } else if (!is_compositing_active && has_backing_store) {
2225 paint_canvas_ = canvas; 2228 paint_canvas_ = canvas;
2226 BackingStoreAura* backing_store = static_cast<BackingStoreAura*>( 2229 BackingStoreAura* backing_store = static_cast<BackingStoreAura*>(
2227 host_->GetBackingStore(true)); 2230 host_->GetBackingStore(true));
2228 paint_canvas_ = NULL; 2231 paint_canvas_ = NULL;
2229 backing_store->SkiaShowRect(gfx::Point(), canvas); 2232 backing_store->SkiaShowRect(gfx::Point(), canvas);
2230 2233
2231 if (paint_observer_) 2234 if (paint_observer_)
2232 paint_observer_->OnPaintComplete(); 2235 paint_observer_->OnPaintComplete();
2236 ui::Compositor* compositor = GetCompositor();
2237 if (compositor) {
2238 compositor->SetLatencyInfo(software_latency_info_);
2239 software_latency_info_.Clear();
2240 }
2233 } else if (aura::Env::GetInstance()->render_white_bg()) { 2241 } else if (aura::Env::GetInstance()->render_white_bg()) {
2234 canvas->DrawColor(SK_ColorWHITE); 2242 canvas->DrawColor(SK_ColorWHITE);
2235 } 2243 }
2236 } 2244 }
2237 2245
2238 void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged( 2246 void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged(
2239 float device_scale_factor) { 2247 float device_scale_factor) {
2240 if (!host_) 2248 if (!host_)
2241 return; 2249 return;
2242 2250
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
3029 RenderWidgetHost* widget) { 3037 RenderWidgetHost* widget) {
3030 return new RenderWidgetHostViewAura(widget); 3038 return new RenderWidgetHostViewAura(widget);
3031 } 3039 }
3032 3040
3033 // static 3041 // static
3034 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3042 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3035 GetScreenInfoForWindow(results, NULL); 3043 GetScreenInfoForWindow(results, NULL);
3036 } 3044 }
3037 3045
3038 } // namespace content 3046 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698