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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // TODO(alokp): SkPicture::suitableForGpuRasterization needs a GrContext. | 210 // TODO(alokp): SkPicture::suitableForGpuRasterization needs a GrContext. |
211 // Ideally this GrContext should be the same as that for rasterizing this | 211 // Ideally this GrContext should be the same as that for rasterizing this |
212 // picture. But we are on the main thread while the rasterization context | 212 // picture. But we are on the main thread while the rasterization context |
213 // may be on the compositor or raster thread. | 213 // may be on the compositor or raster thread. |
214 // SkPicture::suitableForGpuRasterization is not implemented yet. | 214 // SkPicture::suitableForGpuRasterization is not implemented yet. |
215 // Pass a NULL context for now and discuss with skia folks if the context | 215 // Pass a NULL context for now and discuss with skia folks if the context |
216 // is really needed. | 216 // is really needed. |
217 return picture_->suitableForGpuRasterization(NULL); | 217 return picture_->suitableForGpuRasterization(NULL); |
218 } | 218 } |
219 | 219 |
| 220 bool Picture::HasText() const { |
| 221 DCHECK(picture_); |
| 222 return picture_->hasText(); |
| 223 } |
| 224 |
220 void Picture::CloneForDrawing(int num_threads) { | 225 void Picture::CloneForDrawing(int num_threads) { |
221 TRACE_EVENT1("cc", "Picture::CloneForDrawing", "num_threads", num_threads); | 226 TRACE_EVENT1("cc", "Picture::CloneForDrawing", "num_threads", num_threads); |
222 | 227 |
223 // We don't need clones to draw from multiple threads with SkRecord. | 228 // We don't need clones to draw from multiple threads with SkRecord. |
224 if (playback_) { | 229 if (playback_) { |
225 return; | 230 return; |
226 } | 231 } |
227 | 232 |
228 DCHECK(picture_); | 233 DCHECK(picture_); |
229 DCHECK(clones_.empty()); | 234 DCHECK(clones_.empty()); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 scoped_refptr<base::debug::TracedValue> record_data = | 604 scoped_refptr<base::debug::TracedValue> record_data = |
600 new base::debug::TracedValue(); | 605 new base::debug::TracedValue(); |
601 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 606 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); |
602 record_data->BeginArray("layer_rect"); | 607 record_data->BeginArray("layer_rect"); |
603 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); | 608 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); |
604 record_data->EndArray(); | 609 record_data->EndArray(); |
605 return record_data; | 610 return record_data; |
606 } | 611 } |
607 | 612 |
608 } // namespace cc | 613 } // namespace cc |
OLD | NEW |