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

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 684273003: cc: Fix picture layer impl not to create a tiling with invalid size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 SyncFromActiveLayer(twin_layer); 895 SyncFromActiveLayer(twin_layer);
896 } 896 }
897 897
898 needs_post_commit_initialization_ = false; 898 needs_post_commit_initialization_ = false;
899 } 899 }
900 900
901 PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) { 901 PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) {
902 DCHECK(CanHaveTilingWithScale(contents_scale)) << 902 DCHECK(CanHaveTilingWithScale(contents_scale)) <<
903 "contents_scale: " << contents_scale; 903 "contents_scale: " << contents_scale;
904 904
905 PictureLayerTiling* tiling = 905 PictureLayerTiling* tiling = tilings_->AddTiling(contents_scale, bounds());
danakj 2014/10/30 17:27:09 I don't think this is the right answer. If a layer
906 tilings_->AddTiling(contents_scale, pile_->tiling_size());
907 906
908 DCHECK(pile_->HasRecordings()); 907 DCHECK(pile_->HasRecordings());
909 908
910 if (PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer()) 909 if (PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer())
911 twin_layer->SyncTiling(tiling); 910 twin_layer->SyncTiling(tiling);
912 911
913 return tiling; 912 return tiling;
914 } 913 }
915 914
916 void PictureLayerImpl::RemoveTiling(float contents_scale) { 915 void PictureLayerImpl::RemoveTiling(float contents_scale) {
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); 1721 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange();
1723 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; 1722 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start;
1724 return tiling_range.end - 1 - current_tiling_range_offset; 1723 return tiling_range.end - 1 - current_tiling_range_offset;
1725 } 1724 }
1726 } 1725 }
1727 NOTREACHED(); 1726 NOTREACHED();
1728 return 0; 1727 return 0;
1729 } 1728 }
1730 1729
1731 } // namespace cc 1730 } // namespace cc
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