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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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
« cc/PRESUBMIT.py ('K') | « cc/resources/tile.h ('k') | no next file » | 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 gfx::Size tile_size,
19 gfx::Rect content_rect, 19 const gfx::Rect& content_rect,
20 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),
29 contents_scale_(contents_scale), 29 contents_scale_(contents_scale),
30 opaque_rect_(opaque_rect), 30 opaque_rect_(opaque_rect),
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 69
70 size_t Tile::GPUMemoryUsageInBytes() const { 70 size_t Tile::GPUMemoryUsageInBytes() const {
71 size_t total_size = 0; 71 size_t total_size = 0;
72 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) 72 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode)
73 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); 73 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes();
74 return total_size; 74 return total_size;
75 } 75 }
76 76
77 } // namespace cc 77 } // namespace cc
OLDNEW
« cc/PRESUBMIT.py ('K') | « cc/resources/tile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698