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

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

Issue 1024633002: cc: Keep tilings texture size in sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address vmp's comments Created 5 years, 9 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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 8113 matching lines...) Expand 10 before | Expand all | Expand 10 after
8124 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 10); 8124 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 10);
8125 layer->SetBounds(gfx::Size(10, 10)); 8125 layer->SetBounds(gfx::Size(10, 10));
8126 scoped_ptr<FakePictureLayerImpl> nondraw_layer = 8126 scoped_ptr<FakePictureLayerImpl> nondraw_layer =
8127 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 12); 8127 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 12);
8128 nondraw_layer->SetBounds(gfx::Size(10, 10)); 8128 nondraw_layer->SetBounds(gfx::Size(10, 10));
8129 8129
8130 scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile( 8130 scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile(
8131 gfx::Size(10, 10), gfx::Size(10, 10))); 8131 gfx::Size(10, 10), gfx::Size(10, 10)));
8132 Region empty_invalidation; 8132 Region empty_invalidation;
8133 const PictureLayerTilingSet* null_tiling_set = nullptr; 8133 const PictureLayerTilingSet* null_tiling_set = nullptr;
8134 layer->set_gpu_raster_max_texture_size(host_impl_->device_viewport_size());
8134 layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set); 8135 layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set);
8136 nondraw_layer->set_gpu_raster_max_texture_size(
8137 host_impl_->device_viewport_size());
8135 nondraw_layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set); 8138 nondraw_layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set);
8136 8139
8137 layer->AddChild(nondraw_layer.Pass()); 8140 layer->AddChild(nondraw_layer.Pass());
8138 host_impl_->pending_tree()->SetRootLayer(layer.Pass()); 8141 host_impl_->pending_tree()->SetRootLayer(layer.Pass());
8139 8142
8140 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); 8143 LayerTreeImpl* pending_tree = host_impl_->pending_tree();
8141 LayerImpl* pending_layer = pending_tree->root_layer(); 8144 LayerImpl* pending_layer = pending_tree->root_layer();
8142 FakePictureLayerImpl* pending_nondraw_layer = 8145 FakePictureLayerImpl* pending_nondraw_layer =
8143 static_cast<FakePictureLayerImpl*>(pending_layer->children()[0]); 8146 static_cast<FakePictureLayerImpl*>(pending_layer->children()[0]);
8144 8147
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
8242 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 10); 8245 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 10);
8243 layer->SetBounds(gfx::Size(10, 10)); 8246 layer->SetBounds(gfx::Size(10, 10));
8244 scoped_ptr<FakePictureLayerImpl> nondraw_layer = 8247 scoped_ptr<FakePictureLayerImpl> nondraw_layer =
8245 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 12); 8248 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 12);
8246 nondraw_layer->SetBounds(gfx::Size(10, 10)); 8249 nondraw_layer->SetBounds(gfx::Size(10, 10));
8247 8250
8248 scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile( 8251 scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile(
8249 gfx::Size(10, 10), gfx::Size(10, 10))); 8252 gfx::Size(10, 10), gfx::Size(10, 10)));
8250 Region empty_invalidation; 8253 Region empty_invalidation;
8251 const PictureLayerTilingSet* null_tiling_set = nullptr; 8254 const PictureLayerTilingSet* null_tiling_set = nullptr;
8255 layer->set_gpu_raster_max_texture_size(host_impl_->device_viewport_size());
8252 layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set); 8256 layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set);
8257 nondraw_layer->set_gpu_raster_max_texture_size(
8258 host_impl_->device_viewport_size());
8253 nondraw_layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set); 8259 nondraw_layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set);
8254 8260
8255 layer->AddChild(nondraw_layer.Pass()); 8261 layer->AddChild(nondraw_layer.Pass());
8256 host_impl_->pending_tree()->SetRootLayer(layer.Pass()); 8262 host_impl_->pending_tree()->SetRootLayer(layer.Pass());
8257 8263
8258 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); 8264 LayerTreeImpl* pending_tree = host_impl_->pending_tree();
8259 LayerImpl* pending_layer = pending_tree->root_layer(); 8265 LayerImpl* pending_layer = pending_tree->root_layer();
8260 FakePictureLayerImpl* pending_nondraw_layer = 8266 FakePictureLayerImpl* pending_nondraw_layer =
8261 static_cast<FakePictureLayerImpl*>(pending_layer->children()[0]); 8267 static_cast<FakePictureLayerImpl*>(pending_layer->children()[0]);
8262 8268
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
8475 // surface. 8481 // surface.
8476 EXPECT_EQ(0, num_lost_surfaces_); 8482 EXPECT_EQ(0, num_lost_surfaces_);
8477 host_impl_->DidLoseOutputSurface(); 8483 host_impl_->DidLoseOutputSurface();
8478 EXPECT_EQ(1, num_lost_surfaces_); 8484 EXPECT_EQ(1, num_lost_surfaces_);
8479 host_impl_->DidLoseOutputSurface(); 8485 host_impl_->DidLoseOutputSurface();
8480 EXPECT_LE(1, num_lost_surfaces_); 8486 EXPECT_LE(1, num_lost_surfaces_);
8481 } 8487 }
8482 8488
8483 } // namespace 8489 } // namespace
8484 } // namespace cc 8490 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698