| 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/resources/picture.h" | 5 #include "cc/resources/picture.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 EmitTraceSnapshot(); | 241 EmitTraceSnapshot(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void Picture::GatherPixelRefs( | 244 void Picture::GatherPixelRefs( |
| 245 const SkTileGridPicture::TileGridInfo& tile_grid_info) { | 245 const SkTileGridPicture::TileGridInfo& tile_grid_info) { |
| 246 TRACE_EVENT2("cc", "Picture::GatherPixelRefs", | 246 TRACE_EVENT2("cc", "Picture::GatherPixelRefs", |
| 247 "width", layer_rect_.width(), | 247 "width", layer_rect_.width(), |
| 248 "height", layer_rect_.height()); | 248 "height", layer_rect_.height()); |
| 249 | 249 |
| 250 DCHECK(picture_); | 250 DCHECK(picture_); |
| 251 if (!WillPlayBackBitmaps()) |
| 252 return; |
| 251 cell_size_ = gfx::Size( | 253 cell_size_ = gfx::Size( |
| 252 tile_grid_info.fTileInterval.width() + | 254 tile_grid_info.fTileInterval.width() + |
| 253 2 * tile_grid_info.fMargin.width(), | 255 2 * tile_grid_info.fMargin.width(), |
| 254 tile_grid_info.fTileInterval.height() + | 256 tile_grid_info.fTileInterval.height() + |
| 255 2 * tile_grid_info.fMargin.height()); | 257 2 * tile_grid_info.fMargin.height()); |
| 256 DCHECK_GT(cell_size_.width(), 0); | 258 DCHECK_GT(cell_size_.width(), 0); |
| 257 DCHECK_GT(cell_size_.height(), 0); | 259 DCHECK_GT(cell_size_.height(), 0); |
| 258 | 260 |
| 259 int min_x = std::numeric_limits<int>::max(); | 261 int min_x = std::numeric_limits<int>::max(); |
| 260 int min_y = std::numeric_limits<int>::max(); | 262 int min_y = std::numeric_limits<int>::max(); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 scoped_refptr<base::debug::ConvertableToTraceFormat> | 481 scoped_refptr<base::debug::ConvertableToTraceFormat> |
| 480 Picture::AsTraceableRecordData() const { | 482 Picture::AsTraceableRecordData() const { |
| 481 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue()); | 483 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue()); |
| 482 record_data->Set("picture_id", TracedValue::CreateIDRef(this).release()); | 484 record_data->Set("picture_id", TracedValue::CreateIDRef(this).release()); |
| 483 record_data->SetInteger("width", layer_rect_.width()); | 485 record_data->SetInteger("width", layer_rect_.width()); |
| 484 record_data->SetInteger("height", layer_rect_.height()); | 486 record_data->SetInteger("height", layer_rect_.height()); |
| 485 return TracedValue::FromValue(record_data.release()); | 487 return TracedValue::FromValue(record_data.release()); |
| 486 } | 488 } |
| 487 | 489 |
| 488 } // namespace cc | 490 } // namespace cc |
| OLD | NEW |