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

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

Issue 1132443003: cc: Move raster_source from Tile to PrioritizedTile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename var 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_manager.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 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 18 matching lines...) Expand all
29 contents_scale_(contents_scale), 29 contents_scale_(contents_scale),
30 layer_id_(layer_id), 30 layer_id_(layer_id),
31 source_frame_number_(source_frame_number), 31 source_frame_number_(source_frame_number),
32 flags_(flags), 32 flags_(flags),
33 tiling_i_index_(-1), 33 tiling_i_index_(-1),
34 tiling_j_index_(-1), 34 tiling_j_index_(-1),
35 required_for_activation_(false), 35 required_for_activation_(false),
36 required_for_draw_(false), 36 required_for_draw_(false),
37 id_(s_next_id_++), 37 id_(s_next_id_++),
38 scheduled_priority_(0) { 38 scheduled_priority_(0) {
39 set_raster_source(raster_source);
40 } 39 }
41 40
42 Tile::~Tile() { 41 Tile::~Tile() {
43 TRACE_EVENT_OBJECT_DELETED_WITH_ID( 42 TRACE_EVENT_OBJECT_DELETED_WITH_ID(
44 TRACE_DISABLED_BY_DEFAULT("cc.debug"), 43 TRACE_DISABLED_BY_DEFAULT("cc.debug"),
45 "cc::Tile", this); 44 "cc::Tile", this);
46 } 45 }
47 46
48 void Tile::AsValueWithPriorityInto(const TilePriority& priority, 47 void Tile::AsValueInto(base::trace_event::TracedValue* value) const {
49 base::trace_event::TracedValue* res) const {
50 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( 48 TracedValue::MakeDictIntoImplicitSnapshotWithCategory(
51 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); 49 TRACE_DISABLED_BY_DEFAULT("cc.debug"), value, "cc::Tile", this);
52 TracedValue::SetIDRef(raster_source_.get(), res, "picture_pile"); 50 value->SetDouble("contents_scale", contents_scale_);
53 res->SetDouble("contents_scale", contents_scale_);
54 51
55 MathUtil::AddToTracedValue("content_rect", content_rect_, res); 52 MathUtil::AddToTracedValue("content_rect", content_rect_, value);
56 53
57 res->SetInteger("layer_id", layer_id_); 54 value->SetInteger("layer_id", layer_id_);
58 55
59 res->BeginDictionary("combined_priority"); 56 value->BeginDictionary("draw_info");
60 priority.AsValueInto(res); 57 draw_info_.AsValueInto(value);
61 res->EndDictionary(); 58 value->EndDictionary();
62 59
63 res->BeginDictionary("draw_info"); 60 value->SetBoolean("has_resource", HasResource());
64 draw_info_.AsValueInto(res); 61 value->SetBoolean("is_using_gpu_memory", HasResource() || HasRasterTask());
65 res->EndDictionary();
66 62
67 res->SetBoolean("has_resource", HasResource()); 63 value->SetInteger("scheduled_priority", scheduled_priority_);
68 res->SetBoolean("is_using_gpu_memory", HasResource() || HasRasterTask());
69 res->SetString("resolution", TileResolutionToString(priority.resolution));
70 64
71 res->SetInteger("scheduled_priority", scheduled_priority_); 65 value->SetBoolean("use_picture_analysis", use_picture_analysis());
72 66
73 res->SetBoolean("use_picture_analysis", use_picture_analysis()); 67 value->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes());
74
75 res->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes());
76 } 68 }
77 69
78 size_t Tile::GPUMemoryUsageInBytes() const { 70 size_t Tile::GPUMemoryUsageInBytes() const {
79 if (draw_info_.resource_) 71 if (draw_info_.resource_)
80 return draw_info_.resource_->bytes(); 72 return draw_info_.resource_->bytes();
81 return 0; 73 return 0;
82 } 74 }
83 75
84 void Tile::Deleter::operator()(Tile* tile) const { 76 void Tile::Deleter::operator()(Tile* tile) const {
85 TileManager* tile_manager = tile->tile_manager_; 77 TileManager* tile_manager = tile->tile_manager_;
86 tile_manager->Release(tile); 78 tile_manager->Release(tile);
87 } 79 }
88 80
89 } // namespace cc 81 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile.h ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698