| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // TODO(alokp): SkPicture::suitableForGpuRasterization needs a GrContext. | 196 // TODO(alokp): SkPicture::suitableForGpuRasterization needs a GrContext. |
| 197 // Ideally this GrContext should be the same as that for rasterizing this | 197 // Ideally this GrContext should be the same as that for rasterizing this |
| 198 // picture. But we are on the main thread while the rasterization context | 198 // picture. But we are on the main thread while the rasterization context |
| 199 // may be on the compositor or raster thread. | 199 // may be on the compositor or raster thread. |
| 200 // SkPicture::suitableForGpuRasterization is not implemented yet. | 200 // SkPicture::suitableForGpuRasterization is not implemented yet. |
| 201 // Pass a NULL context for now and discuss with skia folks if the context | 201 // Pass a NULL context for now and discuss with skia folks if the context |
| 202 // is really needed. | 202 // is really needed. |
| 203 return picture_->suitableForGpuRasterization(NULL); | 203 return picture_->suitableForGpuRasterization(NULL); |
| 204 } | 204 } |
| 205 | 205 |
| 206 int Picture::ApproximateOpCount() const { |
| 207 DCHECK(picture_); |
| 208 return picture_->approximateOpCount(); |
| 209 } |
| 210 |
| 206 bool Picture::HasText() const { | 211 bool Picture::HasText() const { |
| 207 DCHECK(picture_); | 212 DCHECK(picture_); |
| 208 return picture_->hasText(); | 213 return picture_->hasText(); |
| 209 } | 214 } |
| 210 | 215 |
| 211 void Picture::Record(ContentLayerClient* painter, | 216 void Picture::Record(ContentLayerClient* painter, |
| 212 const SkTileGridFactory::TileGridInfo& tile_grid_info, | 217 const SkTileGridFactory::TileGridInfo& tile_grid_info, |
| 213 RecordingMode recording_mode) { | 218 RecordingMode recording_mode) { |
| 214 TRACE_EVENT2("cc", | 219 TRACE_EVENT2("cc", |
| 215 "Picture::Record", | 220 "Picture::Record", |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 scoped_refptr<base::debug::TracedValue> record_data = | 561 scoped_refptr<base::debug::TracedValue> record_data = |
| 557 new base::debug::TracedValue(); | 562 new base::debug::TracedValue(); |
| 558 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 563 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); |
| 559 record_data->BeginArray("layer_rect"); | 564 record_data->BeginArray("layer_rect"); |
| 560 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); | 565 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); |
| 561 record_data->EndArray(); | 566 record_data->EndArray(); |
| 562 return record_data; | 567 return record_data; |
| 563 } | 568 } |
| 564 | 569 |
| 565 } // namespace cc | 570 } // namespace cc |
| OLD | NEW |