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

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

Issue 18581004: cc: Remove tile ref counting in tile manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ut compile fix Created 7 years, 5 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.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 "cc/debug/traced_value.h" 7 #include "cc/debug/traced_value.h"
8 #include "cc/resources/tile_manager.h" 8 #include "cc/resources/tile_manager.h"
9 #include "third_party/khronos/GLES2/gl2.h" 9 #include "third_party/khronos/GLES2/gl2.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 Tile::Id Tile::s_next_id_ = 0;
14
13 Tile::Tile(TileManager* tile_manager, 15 Tile::Tile(TileManager* tile_manager,
14 PicturePileImpl* picture_pile, 16 PicturePileImpl* picture_pile,
15 gfx::Size tile_size, 17 gfx::Size tile_size,
16 gfx::Rect content_rect, 18 gfx::Rect content_rect,
17 gfx::Rect opaque_rect, 19 gfx::Rect opaque_rect,
18 float contents_scale, 20 float contents_scale,
19 int layer_id, 21 int layer_id,
20 int source_frame_number, 22 int source_frame_number,
21 bool can_use_lcd_text) 23 bool can_use_lcd_text)
22 : tile_manager_(tile_manager), 24 : tile_manager_(tile_manager),
23 tile_size_(tile_size), 25 tile_size_(tile_size),
24 content_rect_(content_rect), 26 content_rect_(content_rect),
25 contents_scale_(contents_scale), 27 contents_scale_(contents_scale),
26 opaque_rect_(opaque_rect), 28 opaque_rect_(opaque_rect),
27 layer_id_(layer_id), 29 layer_id_(layer_id),
28 source_frame_number_(source_frame_number), 30 source_frame_number_(source_frame_number),
29 can_use_lcd_text_(can_use_lcd_text) { 31 can_use_lcd_text_(can_use_lcd_text),
32 id_(s_next_id_++) {
30 set_picture_pile(picture_pile); 33 set_picture_pile(picture_pile);
31 tile_manager_->RegisterTile(this); 34 tile_manager_->RegisterTile(this);
32 } 35 }
33 36
34 Tile::~Tile() { 37 Tile::~Tile() {
35 TRACE_EVENT_OBJECT_DELETED_WITH_ID( 38 TRACE_EVENT_OBJECT_DELETED_WITH_ID(
36 TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::Tile", this); 39 TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::Tile", this);
37 tile_manager_->UnregisterTile(this); 40 tile_manager_->UnregisterTile(this);
38 } 41 }
39 42
(...skipping 10 matching lines...) Expand all
50 } 53 }
51 54
52 size_t Tile::GPUMemoryUsageInBytes() const { 55 size_t Tile::GPUMemoryUsageInBytes() const {
53 size_t total_size = 0; 56 size_t total_size = 0;
54 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) 57 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode)
55 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); 58 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes();
56 return total_size; 59 return total_size;
57 } 60 }
58 61
59 } // namespace cc 62 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile.h ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698