Chromium Code Reviews

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

Issue 367833003: cc: Start using raster/eviction iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
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/debug/trace_event_argument.h" 9 #include "base/debug/trace_event_argument.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 15 matching lines...)
26 int flags) 26 int flags)
27 : RefCountedManaged<Tile>(tile_manager), 27 : RefCountedManaged<Tile>(tile_manager),
28 tile_manager_(tile_manager), 28 tile_manager_(tile_manager),
29 size_(tile_size), 29 size_(tile_size),
30 content_rect_(content_rect), 30 content_rect_(content_rect),
31 contents_scale_(contents_scale), 31 contents_scale_(contents_scale),
32 layer_id_(layer_id), 32 layer_id_(layer_id),
33 source_frame_number_(source_frame_number), 33 source_frame_number_(source_frame_number),
34 flags_(flags), 34 flags_(flags),
35 is_shared_(false), 35 is_shared_(false),
36 tiling_i_index_(-1),
37 tiling_j_index_(-1),
38 required_for_activation_(false),
36 id_(s_next_id_++) { 39 id_(s_next_id_++) {
37 set_picture_pile(picture_pile); 40 set_picture_pile(picture_pile);
38 for (int i = 0; i < NUM_TREES; i++) 41 for (int i = 0; i < NUM_TREES; i++)
39 is_occluded_[i] = false; 42 is_occluded_[i] = false;
40 } 43 }
41 44
42 Tile::~Tile() { 45 Tile::~Tile() {
43 TRACE_EVENT_OBJECT_DELETED_WITH_ID( 46 TRACE_EVENT_OBJECT_DELETED_WITH_ID(
44 TRACE_DISABLED_BY_DEFAULT("cc.debug"), 47 TRACE_DISABLED_BY_DEFAULT("cc.debug"),
45 "cc::Tile", this); 48 "cc::Tile", this);
46 } 49 }
47 50
48 void Tile::SetPriority(WhichTree tree, const TilePriority& priority) { 51 void Tile::SetPriority(WhichTree tree, const TilePriority& priority) {
danakj 2014/09/19 01:41:47 move this to the header and remove the early out
vmpstr 2014/09/19 21:22:53 Done.
49 if (priority == priority_[tree]) 52 if (priority == priority_[tree])
50 return; 53 return;
51 54
52 priority_[tree] = priority; 55 priority_[tree] = priority;
53 tile_manager_->DidChangeTilePriority(this);
54 }
55
56 void Tile::MarkRequiredForActivation() {
57 if (priority_[PENDING_TREE].required_for_activation)
58 return;
59
60 priority_[PENDING_TREE].required_for_activation = true;
61 tile_manager_->DidChangeTilePriority(this);
62 } 56 }
63 57
64 void Tile::AsValueInto(base::debug::TracedValue* res) const { 58 void Tile::AsValueInto(base::debug::TracedValue* res) const {
65 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( 59 TracedValue::MakeDictIntoImplicitSnapshotWithCategory(
66 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); 60 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this);
67 TracedValue::SetIDRef(picture_pile_.get(), res, "picture_pile"); 61 TracedValue::SetIDRef(picture_pile_.get(), res, "picture_pile");
68 res->SetDouble("contents_scale", contents_scale_); 62 res->SetDouble("contents_scale", contents_scale_);
69 63
70 res->BeginArray("content_rect"); 64 res->BeginArray("content_rect");
71 MathUtil::AddToTracedValue(content_rect_, res); 65 MathUtil::AddToTracedValue(content_rect_, res);
(...skipping 44 matching lines...)
116 110
117 bool Tile::HasRasterTask() const { 111 bool Tile::HasRasterTask() const {
118 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { 112 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
119 if (managed_state_.tile_versions[mode].raster_task_.get()) 113 if (managed_state_.tile_versions[mode].raster_task_.get())
120 return true; 114 return true;
121 } 115 }
122 return false; 116 return false;
123 } 117 }
124 118
125 } // namespace cc 119 } // namespace cc
OLDNEW

Powered by Google App Engine