OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/playback/display_item_list.h" | 5 #include "cc/playback/display_item_list.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 if (settings_.use_cached_picture) { | 176 if (settings_.use_cached_picture) { |
177 // Convert to an SkPicture for faster rasterization. | 177 // Convert to an SkPicture for faster rasterization. |
178 DCHECK(settings_.use_cached_picture); | 178 DCHECK(settings_.use_cached_picture); |
179 DCHECK(!picture_); | 179 DCHECK(!picture_); |
180 picture_ = skia::AdoptRef(recorder_->endRecordingAsPicture()); | 180 picture_ = skia::AdoptRef(recorder_->endRecordingAsPicture()); |
181 DCHECK(picture_); | 181 DCHECK(picture_); |
182 picture_memory_usage_ = | 182 picture_memory_usage_ = |
183 SkPictureUtils::ApproximateBytesUsed(picture_.get()); | 183 SkPictureUtils::ApproximateBytesUsed(picture_.get()); |
184 recorder_.reset(); | 184 recorder_.reset(); |
185 canvas_.clear(); | 185 canvas_.clear(); |
| 186 is_suitable_for_gpu_rasterization_ = |
| 187 picture_->suitableForGpuRasterization(nullptr); |
186 } | 188 } |
187 } | 189 } |
188 | 190 |
189 bool DisplayItemList::IsSuitableForGpuRasterization() const { | 191 bool DisplayItemList::IsSuitableForGpuRasterization() const { |
190 return is_suitable_for_gpu_rasterization_; | 192 return is_suitable_for_gpu_rasterization_; |
191 } | 193 } |
192 | 194 |
193 int DisplayItemList::ApproximateOpCount() const { | 195 int DisplayItemList::ApproximateOpCount() const { |
194 return approximate_op_count_; | 196 return approximate_op_count_; |
195 } | 197 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 } | 296 } |
295 | 297 |
296 void DisplayItemList::GetDiscardableImagesInRect( | 298 void DisplayItemList::GetDiscardableImagesInRect( |
297 const gfx::Rect& rect, | 299 const gfx::Rect& rect, |
298 float raster_scale, | 300 float raster_scale, |
299 std::vector<DrawImage>* images) { | 301 std::vector<DrawImage>* images) { |
300 image_map_.GetDiscardableImagesInRect(rect, raster_scale, images); | 302 image_map_.GetDiscardableImagesInRect(rect, raster_scale, images); |
301 } | 303 } |
302 | 304 |
303 } // namespace cc | 305 } // namespace cc |
OLD | NEW |