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

Side by Side Diff: cc/tiles/tile.cc

Issue 2726343004: cc: Optimize decode scheduling for checker-images. (Closed)
Patch Set: fixed tile iteration Created 3 years, 8 months 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
OLDNEW
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/tiles/tile.h" 5 #include "cc/tiles/tile.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 value->SetBoolean("has_resource", draw_info().has_resource()); 62 value->SetBoolean("has_resource", draw_info().has_resource());
63 value->SetBoolean("is_using_gpu_memory", 63 value->SetBoolean("is_using_gpu_memory",
64 draw_info().has_resource() || HasRasterTask()); 64 draw_info().has_resource() || HasRasterTask());
65 value->SetInteger("scheduled_priority", scheduled_priority_); 65 value->SetInteger("scheduled_priority", scheduled_priority_);
66 value->SetBoolean("use_picture_analysis", use_picture_analysis()); 66 value->SetBoolean("use_picture_analysis", use_picture_analysis());
67 value->SetInteger("gpu_memory_usage", 67 value->SetInteger("gpu_memory_usage",
68 base::saturated_cast<int>(GPUMemoryUsageInBytes())); 68 base::saturated_cast<int>(GPUMemoryUsageInBytes()));
69 } 69 }
70 70
71 void Tile::SetImageAnalysisResult(
72 std::vector<DrawImage> images_to_decode_before_raster,
73 std::vector<sk_sp<const SkImage>> images_to_checker) {
74 DCHECK(!is_image_analysis_performed_)
75 << "Image Analysis for a tile should be performed once only";
76
77 is_image_analysis_performed_ = true;
78 images_to_decode_before_raster_ = std::move(images_to_decode_before_raster);
79 images_to_checker_ = std::move(images_to_checker);
80 }
81
71 size_t Tile::GPUMemoryUsageInBytes() const { 82 size_t Tile::GPUMemoryUsageInBytes() const {
72 if (draw_info_.resource_) { 83 if (draw_info_.resource_) {
73 // We can use UncheckedSizeInBytes, since the tile size is determined by the 84 // We can use UncheckedSizeInBytes, since the tile size is determined by the
74 // compositor. 85 // compositor.
75 return ResourceUtil::UncheckedSizeInBytes<size_t>( 86 return ResourceUtil::UncheckedSizeInBytes<size_t>(
76 draw_info_.resource_->size(), draw_info_.resource_->format()); 87 draw_info_.resource_->size(), draw_info_.resource_->format());
77 } 88 }
78 return 0; 89 return 0;
79 } 90 }
80 91
81 } // namespace cc 92 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698