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

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

Issue 1139673008: cc: Make IsReadyToDraw/NeedsRaster usage consistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « cc/resources/tile.h ('k') | cc/resources/tile_draw_info.h » ('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 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/tile.h" 5 #include "cc/resources/tile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/trace_event/trace_event_argument.h" 9 #include "base/trace_event/trace_event_argument.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 value->SetDouble("contents_scale", contents_scale_); 49 value->SetDouble("contents_scale", contents_scale_);
50 50
51 MathUtil::AddToTracedValue("content_rect", content_rect_, value); 51 MathUtil::AddToTracedValue("content_rect", content_rect_, value);
52 52
53 value->SetInteger("layer_id", layer_id_); 53 value->SetInteger("layer_id", layer_id_);
54 54
55 value->BeginDictionary("draw_info"); 55 value->BeginDictionary("draw_info");
56 draw_info_.AsValueInto(value); 56 draw_info_.AsValueInto(value);
57 value->EndDictionary(); 57 value->EndDictionary();
58 58
59 value->SetBoolean("has_resource", HasResource()); 59 value->SetBoolean("has_resource", draw_info().has_resource());
60 value->SetBoolean("is_using_gpu_memory", HasResource() || HasRasterTask()); 60 value->SetBoolean("is_using_gpu_memory",
61 61 draw_info().has_resource() || HasRasterTask());
62 value->SetInteger("scheduled_priority", scheduled_priority_); 62 value->SetInteger("scheduled_priority", scheduled_priority_);
63
64 value->SetBoolean("use_picture_analysis", use_picture_analysis()); 63 value->SetBoolean("use_picture_analysis", use_picture_analysis());
65
66 value->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); 64 value->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes());
67 } 65 }
68 66
69 size_t Tile::GPUMemoryUsageInBytes() const { 67 size_t Tile::GPUMemoryUsageInBytes() const {
70 if (draw_info_.resource_) 68 if (draw_info_.resource_)
71 return draw_info_.resource_->bytes(); 69 return draw_info_.resource_->bytes();
72 return 0; 70 return 0;
73 } 71 }
74 72
75 void Tile::Deleter::operator()(Tile* tile) const { 73 void Tile::Deleter::operator()(Tile* tile) const {
76 TileManager* tile_manager = tile->tile_manager_; 74 TileManager* tile_manager = tile->tile_manager_;
77 tile_manager->Release(tile); 75 tile_manager->Release(tile);
78 } 76 }
79 77
80 } // namespace cc 78 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile.h ('k') | cc/resources/tile_draw_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698