Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/base/util.h" | 9 #include "cc/base/util.h" |
| 10 #include "cc/debug/debug_colors.h" | 10 #include "cc/debug/debug_colors.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 pile_(PicturePileImpl::Create(true)), | 30 pile_(PicturePileImpl::Create(true)), |
| 31 last_content_scale_(0), | 31 last_content_scale_(0), |
| 32 ideal_contents_scale_(0), | 32 ideal_contents_scale_(0), |
| 33 is_mask_(false), | 33 is_mask_(false), |
| 34 ideal_page_scale_(0.f), | 34 ideal_page_scale_(0.f), |
| 35 ideal_device_scale_(0.f), | 35 ideal_device_scale_(0.f), |
| 36 ideal_source_scale_(0.f), | 36 ideal_source_scale_(0.f), |
| 37 raster_page_scale_(0.f), | 37 raster_page_scale_(0.f), |
| 38 raster_device_scale_(0.f), | 38 raster_device_scale_(0.f), |
| 39 raster_source_scale_(0.f), | 39 raster_source_scale_(0.f), |
| 40 raster_contents_scale_(0.f), | |
| 41 low_res_raster_contents_scale_(0.f), | |
| 40 raster_source_scale_was_animating_(false), | 42 raster_source_scale_was_animating_(false), |
| 41 is_using_lcd_text_(true) { | 43 is_using_lcd_text_(true) { |
| 42 } | 44 } |
| 43 | 45 |
| 44 PictureLayerImpl::~PictureLayerImpl() { | 46 PictureLayerImpl::~PictureLayerImpl() { |
| 45 } | 47 } |
| 46 | 48 |
| 47 const char* PictureLayerImpl::LayerTypeAsString() const { | 49 const char* PictureLayerImpl::LayerTypeAsString() const { |
| 48 return "PictureLayer"; | 50 return "PictureLayer"; |
| 49 } | 51 } |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 73 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); | 75 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); |
| 74 | 76 |
| 75 layer_impl->SetIsMask(is_mask_); | 77 layer_impl->SetIsMask(is_mask_); |
| 76 layer_impl->TransferTilingSet(tilings_.Pass()); | 78 layer_impl->TransferTilingSet(tilings_.Pass()); |
| 77 layer_impl->pile_ = pile_; | 79 layer_impl->pile_ = pile_; |
| 78 pile_ = PicturePileImpl::Create(is_using_lcd_text_); | 80 pile_ = PicturePileImpl::Create(is_using_lcd_text_); |
| 79 | 81 |
| 80 layer_impl->raster_page_scale_ = raster_page_scale_; | 82 layer_impl->raster_page_scale_ = raster_page_scale_; |
| 81 layer_impl->raster_device_scale_ = raster_device_scale_; | 83 layer_impl->raster_device_scale_ = raster_device_scale_; |
| 82 layer_impl->raster_source_scale_ = raster_source_scale_; | 84 layer_impl->raster_source_scale_ = raster_source_scale_; |
| 85 layer_impl->raster_contents_scale_ = raster_contents_scale_; | |
| 86 layer_impl->low_res_raster_contents_scale_ = low_res_raster_contents_scale_; | |
| 83 layer_impl->is_using_lcd_text_ = is_using_lcd_text_; | 87 layer_impl->is_using_lcd_text_ = is_using_lcd_text_; |
| 84 } | 88 } |
| 85 | 89 |
| 86 | 90 |
| 87 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, | 91 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, |
| 88 AppendQuadsData* append_quads_data) { | 92 AppendQuadsData* append_quads_data) { |
| 89 const gfx::Rect& rect = visible_content_rect(); | 93 const gfx::Rect& rect = visible_content_rect(); |
| 90 gfx::Rect content_rect(content_bounds()); | 94 gfx::Rect content_rect(content_bounds()); |
| 91 | 95 |
| 92 SharedQuadState* shared_quad_state = | 96 SharedQuadState* shared_quad_state = |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 return default_tile_size; | 394 return default_tile_size; |
| 391 } | 395 } |
| 392 | 396 |
| 393 void PictureLayerImpl::SyncFromActiveLayer() { | 397 void PictureLayerImpl::SyncFromActiveLayer() { |
| 394 DCHECK(layer_tree_impl()->IsPendingTree()); | 398 DCHECK(layer_tree_impl()->IsPendingTree()); |
| 395 | 399 |
| 396 if (!DrawsContent()) { | 400 if (!DrawsContent()) { |
| 397 raster_page_scale_ = 0; | 401 raster_page_scale_ = 0; |
| 398 raster_device_scale_ = 0; | 402 raster_device_scale_ = 0; |
| 399 raster_source_scale_ = 0; | 403 raster_source_scale_ = 0; |
| 404 raster_contents_scale_ = 0; | |
| 405 low_res_raster_contents_scale_ = 0; | |
| 400 return; | 406 return; |
| 401 } | 407 } |
| 402 | 408 |
| 403 // If there is an active tree version of this layer, get a copy of its | 409 // If there is an active tree version of this layer, get a copy of its |
| 404 // tiles. This needs to be done last, after setting invalidation and the | 410 // tiles. This needs to be done last, after setting invalidation and the |
| 405 // pile. | 411 // pile. |
| 406 if (PictureLayerImpl* active_twin = ActiveTwin()) | 412 if (PictureLayerImpl* active_twin = ActiveTwin()) |
| 407 SyncFromActiveLayer(active_twin); | 413 SyncFromActiveLayer(active_twin); |
| 408 } | 414 } |
| 409 | 415 |
| 410 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) { | 416 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) { |
| 411 raster_page_scale_ = other->raster_page_scale_; | 417 raster_page_scale_ = other->raster_page_scale_; |
| 412 raster_device_scale_ = other->raster_device_scale_; | 418 raster_device_scale_ = other->raster_device_scale_; |
| 413 raster_source_scale_ = other->raster_source_scale_; | 419 raster_source_scale_ = other->raster_source_scale_; |
| 420 raster_contents_scale_ = other->raster_contents_scale_; | |
| 421 low_res_raster_contents_scale_ = other->low_res_raster_contents_scale_; | |
| 414 is_using_lcd_text_ = other->is_using_lcd_text_; | 422 is_using_lcd_text_ = other->is_using_lcd_text_; |
| 415 | 423 |
| 416 // Add synthetic invalidations for any recordings that were dropped. As | 424 // Add synthetic invalidations for any recordings that were dropped. As |
| 417 // tiles are updated to point to this new pile, this will force the dropping | 425 // tiles are updated to point to this new pile, this will force the dropping |
| 418 // of tiles that can no longer be rastered. This is not ideal, but is a | 426 // of tiles that can no longer be rastered. This is not ideal, but is a |
| 419 // trade-off for memory (use the same pile as much as possible, by switching | 427 // trade-off for memory (use the same pile as much as possible, by switching |
| 420 // during DidBecomeActive) and for time (don't bother checking every tile | 428 // during DidBecomeActive) and for time (don't bother checking every tile |
| 421 // during activation to see if the new pile can still raster it). | 429 // during activation to see if the new pile can still raster it). |
| 422 // | 430 // |
| 423 // TODO(enne): Clean up this double loop. | 431 // TODO(enne): Clean up this double loop. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 487 } | 495 } |
| 488 return 0; | 496 return 0; |
| 489 } | 497 } |
| 490 | 498 |
| 491 bool PictureLayerImpl::AreVisibleResourcesReady() const { | 499 bool PictureLayerImpl::AreVisibleResourcesReady() const { |
| 492 DCHECK(layer_tree_impl()->IsPendingTree()); | 500 DCHECK(layer_tree_impl()->IsPendingTree()); |
| 493 DCHECK(ideal_contents_scale_); | 501 DCHECK(ideal_contents_scale_); |
| 494 | 502 |
| 495 const gfx::Rect& rect = visible_content_rect(); | 503 const gfx::Rect& rect = visible_content_rect(); |
| 496 | 504 |
| 497 float raster_contents_scale = | |
| 498 raster_page_scale_ * | |
| 499 raster_device_scale_ * | |
| 500 raster_source_scale_; | |
| 501 | |
| 502 float min_acceptable_scale = | 505 float min_acceptable_scale = |
| 503 std::min(raster_contents_scale, ideal_contents_scale_); | 506 std::min(raster_contents_scale_, ideal_contents_scale_); |
| 504 | 507 |
| 505 TreePriority tree_priority = | 508 TreePriority tree_priority = |
| 506 layer_tree_impl()->tile_manager()->GlobalState().tree_priority; | 509 layer_tree_impl()->tile_manager()->GlobalState().tree_priority; |
| 507 bool should_force_uploads = | 510 bool should_force_uploads = |
| 508 tree_priority != SMOOTHNESS_TAKES_PRIORITY && | 511 tree_priority != SMOOTHNESS_TAKES_PRIORITY && |
| 509 layer_tree_impl()->animationRegistrar()-> | 512 layer_tree_impl()->animationRegistrar()-> |
| 510 active_animation_controllers().empty(); | 513 active_animation_controllers().empty(); |
| 511 | 514 |
| 512 if (PictureLayerImpl* twin = ActiveTwin()) { | 515 if (PictureLayerImpl* twin = ActiveTwin()) { |
| 513 float twin_raster_contents_scale = | |
| 514 twin->raster_page_scale_ * | |
| 515 twin->raster_device_scale_ * | |
| 516 twin->raster_source_scale_; | |
| 517 | |
| 518 min_acceptable_scale = std::min( | 516 min_acceptable_scale = std::min( |
| 519 min_acceptable_scale, | 517 min_acceptable_scale, |
| 520 std::min(twin->ideal_contents_scale_, twin_raster_contents_scale)); | 518 std::min(twin->ideal_contents_scale_, twin->raster_contents_scale_)); |
| 521 } | 519 } |
| 522 | 520 |
| 523 Region missing_region = rect; | 521 Region missing_region = rect; |
| 524 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 522 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
| 525 PictureLayerTiling* tiling = tilings_->tiling_at(i); | 523 PictureLayerTiling* tiling = tilings_->tiling_at(i); |
| 526 | 524 |
| 527 if (tiling->contents_scale() < min_acceptable_scale) | 525 if (tiling->contents_scale() < min_acceptable_scale) |
| 528 continue; | 526 continue; |
| 529 | 527 |
| 530 for (PictureLayerTiling::Iterator iter(tiling, contents_scale_x(), rect); | 528 for (PictureLayerTiling::Iterator iter(tiling, contents_scale_x(), rect); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 597 | 595 |
| 598 void PictureLayerImpl::ManageTilings(bool animating_transform_to_screen) { | 596 void PictureLayerImpl::ManageTilings(bool animating_transform_to_screen) { |
| 599 DCHECK(ideal_contents_scale_); | 597 DCHECK(ideal_contents_scale_); |
| 600 DCHECK(ideal_page_scale_); | 598 DCHECK(ideal_page_scale_); |
| 601 DCHECK(ideal_device_scale_); | 599 DCHECK(ideal_device_scale_); |
| 602 DCHECK(ideal_source_scale_); | 600 DCHECK(ideal_source_scale_); |
| 603 | 601 |
| 604 if (pile_->recorded_region().IsEmpty()) | 602 if (pile_->recorded_region().IsEmpty()) |
| 605 return; | 603 return; |
| 606 | 604 |
| 607 bool is_active_layer = layer_tree_impl()->IsActiveTree(); | 605 bool change_target_tiling = |
| 608 bool is_pinching = layer_tree_impl()->PinchGestureActive(); | 606 !raster_page_scale_ || !raster_device_scale_ || !raster_source_scale_ || |
| 607 ShouldAdjustRasterScale(animating_transform_to_screen); | |
| 609 | 608 |
| 610 bool change_target_tiling = false; | 609 if (layer_tree_impl()->IsActiveTree()) |
| 611 | |
| 612 if (!raster_page_scale_ || !raster_device_scale_ || !raster_source_scale_) | |
| 613 change_target_tiling = true; | |
| 614 | |
| 615 // TODO(danakj): Adjust raster_source_scale_ closer to ideal_source_scale_ at | |
| 616 // a throttled rate. Possibly make use of invalidation_.IsEmpty() on pending | |
| 617 // tree. This will allow CSS scale changes to get re-rastered at an | |
| 618 // appropriate rate. | |
| 619 | |
| 620 if (is_active_layer) { | |
| 621 if (raster_source_scale_was_animating_ && !animating_transform_to_screen) | |
| 622 change_target_tiling = true; | |
| 623 raster_source_scale_was_animating_ = animating_transform_to_screen; | 610 raster_source_scale_was_animating_ = animating_transform_to_screen; |
|
danakj
2013/03/25 20:13:03
Can you add a comment saying that this is setting
Xianzhu
2013/03/25 20:42:23
Done.
| |
| 624 } | |
| 625 | |
| 626 if (is_active_layer && is_pinching && raster_page_scale_) { | |
| 627 // If the page scale diverges too far during pinch, change raster target to | |
| 628 // the current page scale. | |
| 629 float ratio = PositiveRatio(ideal_page_scale_, raster_page_scale_); | |
| 630 if (ratio >= kMaxScaleRatioDuringPinch) | |
| 631 change_target_tiling = true; | |
| 632 } | |
| 633 | |
| 634 if (!is_pinching) { | |
| 635 // When not pinching, match the ideal page scale factor. | |
| 636 if (raster_page_scale_ != ideal_page_scale_) | |
| 637 change_target_tiling = true; | |
| 638 } | |
| 639 | |
| 640 // Always match the ideal device scale factor. | |
| 641 if (raster_device_scale_ != ideal_device_scale_) | |
| 642 change_target_tiling = true; | |
| 643 | 611 |
| 644 if (!change_target_tiling) | 612 if (!change_target_tiling) |
| 645 return; | 613 return; |
| 646 | 614 |
| 647 raster_page_scale_ = ideal_page_scale_; | 615 raster_page_scale_ = ideal_page_scale_; |
| 648 raster_device_scale_ = ideal_device_scale_; | 616 raster_device_scale_ = ideal_device_scale_; |
| 649 raster_source_scale_ = ideal_source_scale_; | 617 raster_source_scale_ = ideal_source_scale_; |
| 650 | 618 |
| 651 float raster_contents_scale; | |
| 652 float low_res_raster_contents_scale; | |
| 653 CalculateRasterContentsScale(animating_transform_to_screen, | 619 CalculateRasterContentsScale(animating_transform_to_screen, |
| 654 &raster_contents_scale, | 620 &raster_contents_scale_, |
| 655 &low_res_raster_contents_scale); | 621 &low_res_raster_contents_scale_); |
| 656 | 622 |
| 657 PictureLayerTiling* high_res = NULL; | 623 PictureLayerTiling* high_res = NULL; |
| 658 PictureLayerTiling* low_res = NULL; | 624 PictureLayerTiling* low_res = NULL; |
| 659 | 625 |
| 660 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { | 626 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { |
| 661 PictureLayerTiling* tiling = tilings_->tiling_at(i); | 627 PictureLayerTiling* tiling = tilings_->tiling_at(i); |
| 662 if (tiling->contents_scale() == raster_contents_scale) | 628 if (tiling->contents_scale() == raster_contents_scale_) |
| 663 high_res = tiling; | 629 high_res = tiling; |
| 664 if (tiling->contents_scale() == low_res_raster_contents_scale) | 630 if (tiling->contents_scale() == low_res_raster_contents_scale_) |
| 665 low_res = tiling; | 631 low_res = tiling; |
| 666 | 632 |
| 667 // Reset all tilings to non-ideal until the end of this function. | 633 // Reset all tilings to non-ideal until the end of this function. |
| 668 tiling->set_resolution(NON_IDEAL_RESOLUTION); | 634 tiling->set_resolution(NON_IDEAL_RESOLUTION); |
| 669 } | 635 } |
| 670 | 636 |
| 671 if (!high_res) { | 637 if (!high_res) { |
| 672 high_res = AddTiling(raster_contents_scale); | 638 high_res = AddTiling(raster_contents_scale_); |
| 673 if (raster_contents_scale == low_res_raster_contents_scale) | 639 if (raster_contents_scale_ == low_res_raster_contents_scale_) |
| 674 low_res = high_res; | 640 low_res = high_res; |
| 675 } | 641 } |
| 676 if (!low_res && low_res != high_res) | 642 if (!low_res && low_res != high_res) |
| 677 low_res = AddTiling(low_res_raster_contents_scale); | 643 low_res = AddTiling(low_res_raster_contents_scale_); |
| 678 | 644 |
| 679 if (high_res) | 645 if (high_res) |
| 680 high_res->set_resolution(HIGH_RESOLUTION); | 646 high_res->set_resolution(HIGH_RESOLUTION); |
| 681 if (low_res && low_res != high_res) | 647 if (low_res && low_res != high_res) |
| 682 low_res->set_resolution(LOW_RESOLUTION); | 648 low_res->set_resolution(LOW_RESOLUTION); |
| 683 } | 649 } |
| 684 | 650 |
| 651 bool PictureLayerImpl::ShouldAdjustRasterScale( | |
| 652 bool animating_transform_to_screen) const { | |
| 653 // TODO(danakj): Adjust raster source scale closer to ideal source scale at | |
| 654 // a throttled rate. Possibly make use of invalidation_.IsEmpty() on pending | |
| 655 // tree. This will allow CSS scale changes to get re-rastered at an | |
| 656 // appropriate rate. | |
| 657 | |
| 658 bool is_active_layer = layer_tree_impl()->IsActiveTree(); | |
| 659 if (is_active_layer && raster_source_scale_was_animating_ && | |
| 660 !animating_transform_to_screen) | |
| 661 return true; | |
| 662 | |
| 663 bool is_pinching = layer_tree_impl()->PinchGestureActive(); | |
| 664 if (is_active_layer && is_pinching && raster_page_scale_) { | |
| 665 // If the page scale diverges too far during pinch, change raster target to | |
| 666 // the current page scale. | |
| 667 float ratio = PositiveRatio(ideal_page_scale_, raster_page_scale_); | |
| 668 if (ratio >= kMaxScaleRatioDuringPinch) | |
| 669 return true; | |
| 670 } | |
| 671 | |
| 672 if (!is_pinching) { | |
| 673 // When not pinching, match the ideal page scale factor. | |
| 674 if (raster_page_scale_ != ideal_page_scale_) | |
| 675 return true; | |
| 676 } | |
| 677 | |
| 678 // Always match the ideal device scale factor. | |
| 679 if (raster_device_scale_ != ideal_device_scale_) | |
| 680 return true; | |
| 681 | |
| 682 return false; | |
| 683 } | |
| 684 | |
| 685 void PictureLayerImpl::CalculateRasterContentsScale( | 685 void PictureLayerImpl::CalculateRasterContentsScale( |
| 686 bool animating_transform_to_screen, | 686 bool animating_transform_to_screen, |
| 687 float* raster_contents_scale, | 687 float* raster_contents_scale, |
| 688 float* low_res_raster_contents_scale) { | 688 float* low_res_raster_contents_scale) const { |
| 689 *raster_contents_scale = ideal_contents_scale_; | 689 *raster_contents_scale = ideal_contents_scale_; |
| 690 | 690 |
| 691 // Don't allow animating CSS scales to drop below 1. | 691 // Don't allow animating CSS scales to drop below 1. |
| 692 if (animating_transform_to_screen) { | 692 if (animating_transform_to_screen) { |
| 693 *raster_contents_scale = std::max( | 693 *raster_contents_scale = std::max( |
| 694 *raster_contents_scale, 1.f * ideal_page_scale_ * ideal_device_scale_); | 694 *raster_contents_scale, 1.f * ideal_page_scale_ * ideal_device_scale_); |
| 695 } | 695 } |
| 696 | 696 |
| 697 float low_res_factor = | 697 float low_res_factor = |
| 698 layer_tree_impl()->settings().low_res_contents_scale_factor; | 698 layer_tree_impl()->settings().low_res_contents_scale_factor; |
| 699 *low_res_raster_contents_scale = std::max( | 699 *low_res_raster_contents_scale = std::max( |
| 700 *raster_contents_scale * low_res_factor, | 700 *raster_contents_scale * low_res_factor, |
| 701 MinimumContentsScale()); | 701 MinimumContentsScale()); |
| 702 } | 702 } |
| 703 | 703 |
| 704 void PictureLayerImpl::CleanUpTilingsOnActiveLayer( | 704 void PictureLayerImpl::CleanUpTilingsOnActiveLayer( |
| 705 std::vector<PictureLayerTiling*> used_tilings) { | 705 std::vector<PictureLayerTiling*> used_tilings) { |
| 706 DCHECK(layer_tree_impl()->IsActiveTree()); | 706 DCHECK(layer_tree_impl()->IsActiveTree()); |
| 707 | 707 |
| 708 float raster_contents_scale = | |
| 709 raster_page_scale_ * raster_device_scale_ * raster_source_scale_; | |
| 710 | |
| 711 float min_acceptable_high_res_scale = std::min( | 708 float min_acceptable_high_res_scale = std::min( |
| 712 raster_contents_scale, ideal_contents_scale_); | 709 raster_contents_scale_, ideal_contents_scale_); |
| 713 float max_acceptable_high_res_scale = std::max( | 710 float max_acceptable_high_res_scale = std::max( |
| 714 raster_contents_scale, ideal_contents_scale_); | 711 raster_contents_scale_, ideal_contents_scale_); |
| 715 | 712 |
| 716 PictureLayerImpl* twin = PendingTwin(); | 713 PictureLayerImpl* twin = PendingTwin(); |
| 717 if (twin) { | 714 if (twin) { |
| 718 float twin_raster_contents_scale = | |
| 719 twin->raster_page_scale_ * | |
| 720 twin->raster_device_scale_ * | |
| 721 twin->raster_source_scale_; | |
| 722 | |
| 723 min_acceptable_high_res_scale = std::min( | 715 min_acceptable_high_res_scale = std::min( |
| 724 min_acceptable_high_res_scale, | 716 min_acceptable_high_res_scale, |
| 725 std::min(twin_raster_contents_scale, twin->ideal_contents_scale_)); | 717 std::min(twin->raster_contents_scale_, twin->ideal_contents_scale_)); |
| 726 max_acceptable_high_res_scale = std::max( | 718 max_acceptable_high_res_scale = std::max( |
| 727 max_acceptable_high_res_scale, | 719 max_acceptable_high_res_scale, |
| 728 std::max(twin_raster_contents_scale, twin->ideal_contents_scale_)); | 720 std::max(twin->raster_contents_scale_, twin->ideal_contents_scale_)); |
| 729 } | 721 } |
| 730 | 722 |
| 731 float low_res_factor = | 723 float low_res_factor = |
| 732 layer_tree_impl()->settings().low_res_contents_scale_factor; | 724 layer_tree_impl()->settings().low_res_contents_scale_factor; |
| 733 | 725 |
| 734 float min_acceptable_low_res_scale = | 726 float min_acceptable_low_res_scale = |
| 735 low_res_factor * min_acceptable_high_res_scale; | 727 low_res_factor * min_acceptable_high_res_scale; |
| 736 float max_acceptable_low_res_scale = | 728 float max_acceptable_low_res_scale = |
| 737 low_res_factor * max_acceptable_high_res_scale; | 729 low_res_factor * max_acceptable_high_res_scale; |
| 738 | 730 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 846 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { | 838 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { |
| 847 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 839 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 848 LayerImpl::AsValueInto(state.get()); | 840 LayerImpl::AsValueInto(state.get()); |
| 849 | 841 |
| 850 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); | 842 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); |
| 851 state->Set("tilings", tilings_->AsValue().release()); | 843 state->Set("tilings", tilings_->AsValue().release()); |
| 852 return state.PassAs<base::Value>(); | 844 return state.PassAs<base::Value>(); |
| 853 } | 845 } |
| 854 | 846 |
| 855 } // namespace cc | 847 } // namespace cc |
| OLD | NEW |