Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: cc/playback/display_item_list.cc

Issue 1538913002: cc: Restore GPU suitability check in cached_picture case. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unit tests Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698