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

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 13637017: Delete layout_viewport_size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 7 years, 8 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 19 matching lines...) Expand all
30 #include "cc/layers/scrollbar_layer.h" 30 #include "cc/layers/scrollbar_layer.h"
31 #include "cc/resources/prioritized_resource_manager.h" 31 #include "cc/resources/prioritized_resource_manager.h"
32 #include "cc/trees/layer_tree_host_client.h" 32 #include "cc/trees/layer_tree_host_client.h"
33 #include "cc/trees/layer_tree_host_common.h" 33 #include "cc/trees/layer_tree_host_common.h"
34 #include "cc/trees/layer_tree_host_impl.h" 34 #include "cc/trees/layer_tree_host_impl.h"
35 #include "cc/trees/layer_tree_impl.h" 35 #include "cc/trees/layer_tree_impl.h"
36 #include "cc/trees/occlusion_tracker.h" 36 #include "cc/trees/occlusion_tracker.h"
37 #include "cc/trees/single_thread_proxy.h" 37 #include "cc/trees/single_thread_proxy.h"
38 #include "cc/trees/thread_proxy.h" 38 #include "cc/trees/thread_proxy.h"
39 #include "cc/trees/tree_synchronizer.h" 39 #include "cc/trees/tree_synchronizer.h"
40 #include "ui/gfx/size_conversions.h"
40 41
41 namespace { 42 namespace {
42 static int s_num_layer_tree_instances; 43 static int s_num_layer_tree_instances;
43 } 44 }
44 45
45 namespace cc { 46 namespace cc {
46 47
47 RendererCapabilities::RendererCapabilities() 48 RendererCapabilities::RendererCapabilities()
48 : best_texture_format(0), 49 : best_texture_format(0),
49 using_partial_swap(false), 50 using_partial_swap(false),
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 page_scale_delta = sync_tree->page_scale_delta(); 336 page_scale_delta = sync_tree->page_scale_delta();
336 sent_page_scale_delta = sync_tree->sent_page_scale_delta(); 337 sent_page_scale_delta = sync_tree->sent_page_scale_delta();
337 sync_tree->set_sent_page_scale_delta(1.f); 338 sync_tree->set_sent_page_scale_delta(1.f);
338 } 339 }
339 340
340 sync_tree->SetPageScaleFactorAndLimits(page_scale_factor_, 341 sync_tree->SetPageScaleFactorAndLimits(page_scale_factor_,
341 min_page_scale_factor_, 342 min_page_scale_factor_,
342 max_page_scale_factor_); 343 max_page_scale_factor_);
343 sync_tree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); 344 sync_tree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta);
344 345
345 host_impl->SetViewportSize(layout_viewport_size_, device_viewport_size_); 346 host_impl->SetViewportSize(device_viewport_size_);
346 host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_); 347 host_impl->SetOverdrawBottomHeight(overdraw_bottom_height_);
347 host_impl->SetDeviceScaleFactor(device_scale_factor_); 348 host_impl->SetDeviceScaleFactor(device_scale_factor_);
348 host_impl->SetDebugState(debug_state_); 349 host_impl->SetDebugState(debug_state_);
349 if (pending_page_scale_animation_) { 350 if (pending_page_scale_animation_) {
350 host_impl->StartPageScaleAnimation( 351 host_impl->StartPageScaleAnimation(
351 pending_page_scale_animation_->target_offset, 352 pending_page_scale_animation_->target_offset,
352 pending_page_scale_animation_->use_anchor, 353 pending_page_scale_animation_->use_anchor,
353 pending_page_scale_animation_->scale, 354 pending_page_scale_animation_->scale,
354 base::TimeTicks::Now(), 355 base::TimeTicks::Now(),
355 pending_page_scale_animation_->duration); 356 pending_page_scale_animation_->duration);
(...skipping 21 matching lines...) Expand all
377 sync_tree->DidBecomeActive(); 378 sync_tree->DidBecomeActive();
378 } 379 }
379 380
380 commit_number_++; 381 commit_number_++;
381 } 382 }
382 383
383 void LayerTreeHost::SetPinchZoomScrollbarsBoundsAndPosition() { 384 void LayerTreeHost::SetPinchZoomScrollbarsBoundsAndPosition() {
384 if (!pinch_zoom_scrollbar_horizontal_ || !pinch_zoom_scrollbar_vertical_) 385 if (!pinch_zoom_scrollbar_horizontal_ || !pinch_zoom_scrollbar_vertical_)
385 return; 386 return;
386 387
387 gfx::Size size = layout_viewport_size(); 388 gfx::Size size = gfx::ToCeiledSize(
389 gfx::ScaleSize(device_viewport_size(), 1 / device_scale_factor()));
danakj 2013/04/09 00:04:35 nit: 1.f
388 int track_width = PinchZoomScrollbarGeometry::kTrackWidth; 390 int track_width = PinchZoomScrollbarGeometry::kTrackWidth;
389 391
390 pinch_zoom_scrollbar_horizontal_->SetBounds( 392 pinch_zoom_scrollbar_horizontal_->SetBounds(
391 gfx::Size(size.width() - track_width, track_width)); 393 gfx::Size(size.width() - track_width, track_width));
392 pinch_zoom_scrollbar_horizontal_->SetPosition( 394 pinch_zoom_scrollbar_horizontal_->SetPosition(
393 gfx::PointF(0, size.height() - track_width)); 395 gfx::PointF(0, size.height() - track_width));
394 396
395 pinch_zoom_scrollbar_vertical_->SetBounds( 397 pinch_zoom_scrollbar_vertical_->SetBounds(
396 gfx::Size(track_width, size.height() - track_width)); 398 gfx::Size(track_width, size.height() - track_width));
397 pinch_zoom_scrollbar_vertical_->SetPosition( 399 pinch_zoom_scrollbar_vertical_->SetPosition(
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 return; 618 return;
617 619
618 debug_state_ = new_debug_state; 620 debug_state_ = new_debug_state;
619 621
620 rendering_stats_instrumentation_->set_record_rendering_stats( 622 rendering_stats_instrumentation_->set_record_rendering_stats(
621 debug_state_.RecordRenderingStats()); 623 debug_state_.RecordRenderingStats());
622 624
623 SetNeedsCommit(); 625 SetNeedsCommit();
624 } 626 }
625 627
626 void LayerTreeHost::SetViewportSize(gfx::Size layout_viewport_size, 628 void LayerTreeHost::SetViewportSize(gfx::Size device_viewport_size) {
627 gfx::Size device_viewport_size) { 629 if (device_viewport_size == device_viewport_size_)
628 if (layout_viewport_size == layout_viewport_size_ &&
629 device_viewport_size == device_viewport_size_)
630 return; 630 return;
631 631
632 layout_viewport_size_ = layout_viewport_size;
633 device_viewport_size_ = device_viewport_size; 632 device_viewport_size_ = device_viewport_size;
634 633
635 SetPinchZoomScrollbarsBoundsAndPosition(); 634 SetPinchZoomScrollbarsBoundsAndPosition();
636 SetNeedsCommit(); 635 SetNeedsCommit();
637 } 636 }
638 637
639 void LayerTreeHost::SetOverdrawBottomHeight(float overdraw_bottom_height) { 638 void LayerTreeHost::SetOverdrawBottomHeight(float overdraw_bottom_height) {
640 if (overdraw_bottom_height_ == overdraw_bottom_height) 639 if (overdraw_bottom_height_ == overdraw_bottom_height)
641 return; 640 return;
642 641
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 return true; 704 return true;
706 } 705 }
707 706
708 void LayerTreeHost::UpdateLayers(ResourceUpdateQueue* queue, 707 void LayerTreeHost::UpdateLayers(ResourceUpdateQueue* queue,
709 size_t memory_allocation_limit_bytes) { 708 size_t memory_allocation_limit_bytes) {
710 DCHECK(renderer_initialized_); 709 DCHECK(renderer_initialized_);
711 710
712 if (!root_layer()) 711 if (!root_layer())
713 return; 712 return;
714 713
715 if (layout_viewport_size().IsEmpty()) 714 if (device_viewport_size().IsEmpty())
716 return; 715 return;
717 716
718 if (memory_allocation_limit_bytes) { 717 if (memory_allocation_limit_bytes) {
719 contents_texture_manager_->SetMaxMemoryLimitBytes( 718 contents_texture_manager_->SetMaxMemoryLimitBytes(
720 memory_allocation_limit_bytes); 719 memory_allocation_limit_bytes);
721 } 720 }
722 721
723 UpdateLayers(root_layer(), queue); 722 UpdateLayers(root_layer(), queue);
724 } 723 }
725 724
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 bool start_ready_animations = true; 1069 bool start_ready_animations = true;
1071 (*iter).second->UpdateState(start_ready_animations, NULL); 1070 (*iter).second->UpdateState(start_ready_animations, NULL);
1072 } 1071 }
1073 } 1072 }
1074 1073
1075 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { 1074 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() {
1076 return proxy_->CapturePicture(); 1075 return proxy_->CapturePicture();
1077 } 1076 }
1078 1077
1079 } // namespace cc 1078 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698