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

Side by Side Diff: cc/playback/picture_pile.cc

Issue 1349913002: Cache gpu suitability in DisplayItemList, remove SetUnsuitable...ForTesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Needs more nullptr Created 5 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
OLDNEW
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/playback/picture_pile.h" 5 #include "cc/playback/picture_pile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 return is_suitable_for_gpu_rasterization_; 605 return is_suitable_for_gpu_rasterization_;
606 } 606 }
607 607
608 void PicturePile::SetTileGridSize(const gfx::Size& tile_grid_size) { 608 void PicturePile::SetTileGridSize(const gfx::Size& tile_grid_size) {
609 DCHECK_GT(tile_grid_size.width(), 0); 609 DCHECK_GT(tile_grid_size.width(), 0);
610 DCHECK_GT(tile_grid_size.height(), 0); 610 DCHECK_GT(tile_grid_size.height(), 0);
611 611
612 tile_grid_size_ = tile_grid_size; 612 tile_grid_size_ = tile_grid_size;
613 } 613 }
614 614
615 void PicturePile::SetUnsuitableForGpuRasterizationForTesting() {
616 is_suitable_for_gpu_rasterization_ = false;
617 }
618
619 bool PicturePile::CanRasterSlowTileCheck(const gfx::Rect& layer_rect) const { 615 bool PicturePile::CanRasterSlowTileCheck(const gfx::Rect& layer_rect) const {
620 bool include_borders = false; 616 bool include_borders = false;
621 for (TilingData::Iterator tile_iter(&tiling_, layer_rect, include_borders); 617 for (TilingData::Iterator tile_iter(&tiling_, layer_rect, include_borders);
622 tile_iter; ++tile_iter) { 618 tile_iter; ++tile_iter) {
623 PictureMap::const_iterator map_iter = picture_map_.find(tile_iter.index()); 619 PictureMap::const_iterator map_iter = picture_map_.find(tile_iter.index());
624 if (map_iter == picture_map_.end()) 620 if (map_iter == picture_map_.end())
625 return false; 621 return false;
626 } 622 }
627 return true; 623 return true;
628 } 624 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 677
682 void PicturePile::SetBufferPixels(int new_buffer_pixels) { 678 void PicturePile::SetBufferPixels(int new_buffer_pixels) {
683 if (new_buffer_pixels == buffer_pixels()) 679 if (new_buffer_pixels == buffer_pixels())
684 return; 680 return;
685 681
686 Clear(); 682 Clear();
687 tiling_.SetBorderTexels(new_buffer_pixels); 683 tiling_.SetBorderTexels(new_buffer_pixels);
688 } 684 }
689 685
690 } // namespace cc 686 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698