| 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.h" | 5 #include "cc/layers/picture_layer.h" | 
| 6 | 6 | 
| 7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" | 
| 8 #include "cc/layers/picture_layer_impl.h" | 8 #include "cc/layers/picture_layer_impl.h" | 
| 9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" | 
| 10 #include "ui/gfx/rect_conversions.h" | 10 #include "ui/gfx/rect_conversions.h" | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 56   layer_impl->invalidation_.Clear(); | 56   layer_impl->invalidation_.Clear(); | 
| 57   layer_impl->invalidation_.Swap(&pile_invalidation_); | 57   layer_impl->invalidation_.Swap(&pile_invalidation_); | 
| 58   layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get()); | 58   layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get()); | 
| 59 } | 59 } | 
| 60 | 60 | 
| 61 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { | 61 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { | 
| 62   Layer::SetLayerTreeHost(host); | 62   Layer::SetLayerTreeHost(host); | 
| 63   if (host) { | 63   if (host) { | 
| 64     pile_->SetMinContentsScale(host->settings().minimum_contents_scale); | 64     pile_->SetMinContentsScale(host->settings().minimum_contents_scale); | 
| 65     pile_->SetTileGridSize(host->settings().default_tile_size); | 65     pile_->SetTileGridSize(host->settings().default_tile_size); | 
| 66     pile_->set_num_raster_threads(host->settings().num_raster_threads); |  | 
| 67     pile_->set_slow_down_raster_scale_factor( | 66     pile_->set_slow_down_raster_scale_factor( | 
| 68         host->debug_state().slow_down_raster_scale_factor); | 67         host->debug_state().slow_down_raster_scale_factor); | 
| 69     pile_->set_show_debug_picture_borders( | 68     pile_->set_show_debug_picture_borders( | 
| 70         host->debug_state().show_picture_borders); | 69         host->debug_state().show_picture_borders); | 
| 71   } | 70   } | 
| 72 } | 71 } | 
| 73 | 72 | 
| 74 void PictureLayer::SetNeedsDisplayRect(const gfx::RectF& layer_rect) { | 73 void PictureLayer::SetNeedsDisplayRect(const gfx::RectF& layer_rect) { | 
| 75   gfx::Rect rect = gfx::ToEnclosedRect(layer_rect); | 74   gfx::Rect rect = gfx::ToEnclosedRect(layer_rect); | 
| 76   if (!rect.IsEmpty()) { | 75   if (!rect.IsEmpty()) { | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 155   client_->PaintContents(canvas, gfx::Rect(width, height), &opaque); | 154   client_->PaintContents(canvas, gfx::Rect(width, height), &opaque); | 
| 156   picture->endRecording(); | 155   picture->endRecording(); | 
| 157   return picture; | 156   return picture; | 
| 158 } | 157 } | 
| 159 | 158 | 
| 160 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 159 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 
| 161   benchmark->RunOnLayer(this); | 160   benchmark->RunOnLayer(this); | 
| 162 } | 161 } | 
| 163 | 162 | 
| 164 }  // namespace cc | 163 }  // namespace cc | 
| OLD | NEW | 
|---|