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

Side by Side Diff: android_webview/browser/browser_view_renderer.cc

Issue 543313002: Handle tile prioritization correctly when global visible rect is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "android_webview/browser/browser_view_renderer.h" 5 #include "android_webview/browser/browser_view_renderer.h"
6 6
7 #include "android_webview/browser/browser_view_renderer_client.h" 7 #include "android_webview/browser/browser_view_renderer_client.h"
8 #include "android_webview/browser/shared_renderer_state.h" 8 #include "android_webview/browser/shared_renderer_state.h"
9 #include "android_webview/common/aw_switches.h" 9 #include "android_webview/common/aw_switches.h"
10 #include "android_webview/public/browser/draw_gl.h" 10 #include "android_webview/public/browser/draw_gl.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 gfx::Rect clip = viewport; 292 gfx::Rect clip = viewport;
293 gfx::Transform transform_for_tile_priority = 293 gfx::Transform transform_for_tile_priority =
294 parent_draw_constraints_.transform; 294 parent_draw_constraints_.transform;
295 295
296 // If the WebView is on a layer, WebView does not know what transform is 296 // If the WebView is on a layer, WebView does not know what transform is
297 // applied onto the layer so global visible rect does not make sense here. 297 // applied onto the layer so global visible rect does not make sense here.
298 // In this case, just use the surface rect for tiling. 298 // In this case, just use the surface rect for tiling.
299 gfx::Rect viewport_rect_for_tile_priority; 299 gfx::Rect viewport_rect_for_tile_priority;
300 if (parent_draw_constraints_.is_layer) 300 if (parent_draw_constraints_.is_layer)
301 viewport_rect_for_tile_priority = parent_draw_constraints_.surface_rect; 301 viewport_rect_for_tile_priority = parent_draw_constraints_.surface_rect;
302 else 302 else if (!last_on_draw_global_visible_rect_.IsEmpty())
303 viewport_rect_for_tile_priority = last_on_draw_global_visible_rect_; 303 viewport_rect_for_tile_priority = last_on_draw_global_visible_rect_;
304 else {
305 // An empty viewport rect for tile priority will make cc fallback to use
306 // the WebView size as viewport rect for tile priority, which is not what
307 // we want. Instead, use the smallest non-empty rect for it.
308 viewport_rect_for_tile_priority = gfx::Rect(0, 0, 1, 1);
309 }
304 310
305 scoped_ptr<cc::CompositorFrame> frame = 311 scoped_ptr<cc::CompositorFrame> frame =
306 compositor_->DemandDrawHw(surface_size, 312 compositor_->DemandDrawHw(surface_size,
307 gfx::Transform(), 313 gfx::Transform(),
308 viewport, 314 viewport,
309 clip, 315 clip,
310 viewport_rect_for_tile_priority, 316 viewport_rect_for_tile_priority,
311 transform_for_tile_priority); 317 transform_for_tile_priority);
312 if (!frame.get()) 318 if (!frame.get())
313 return false; 319 return false;
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 base::StringAppendF(&str, 821 base::StringAppendF(&str,
816 "surface width height: [%d %d] ", 822 "surface width height: [%d %d] ",
817 draw_info->width, 823 draw_info->width,
818 draw_info->height); 824 draw_info->height);
819 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); 825 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer);
820 } 826 }
821 return str; 827 return str;
822 } 828 }
823 829
824 } // namespace android_webview 830 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698