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

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

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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/base/math_util.h" 7 #include "cc/base/math_util.h"
8 #include "cc/debug/traced_value.h" 8 #include "cc/debug/traced_value.h"
9 #include "cc/resources/tile_manager.h" 9 #include "cc/resources/tile_manager.h"
10 #include "third_party/khronos/GLES2/gl2.h" 10 #include "third_party/khronos/GLES2/gl2.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 Tile::Id Tile::s_next_id_ = 0; 14 Tile::Id Tile::s_next_id_ = 0;
15 15
16 Tile::Tile(TileManager* tile_manager, 16 Tile::Tile(TileManager* tile_manager,
17 PicturePileImpl* picture_pile, 17 PicturePileImpl* picture_pile,
18 gfx::Size tile_size, 18 const gfx::Size& tile_size,
19 const gfx::Rect& content_rect, 19 const gfx::Rect& content_rect,
20 const gfx::Rect& opaque_rect, 20 const gfx::Rect& opaque_rect,
21 float contents_scale, 21 float contents_scale,
22 int layer_id, 22 int layer_id,
23 int source_frame_number, 23 int source_frame_number,
24 int flags) 24 int flags)
25 : RefCountedManaged<Tile>(tile_manager), 25 : RefCountedManaged<Tile>(tile_manager),
26 tile_manager_(tile_manager), 26 tile_manager_(tile_manager),
27 tile_size_(tile_size), 27 tile_size_(tile_size),
28 content_rect_(content_rect), 28 content_rect_(content_rect),
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 size_t Tile::GPUMemoryUsageInBytes() const { 77 size_t Tile::GPUMemoryUsageInBytes() const {
78 size_t total_size = 0; 78 size_t total_size = 0;
79 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) 79 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode)
80 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); 80 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes();
81 return total_size; 81 return total_size;
82 } 82 }
83 83
84 } // namespace cc 84 } // 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