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

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

Issue 69343005: Added preliminary support for tile rasterization with Ganesh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for tests that pass NULL resource_provider/context_provider. 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
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 gfx::Rect content_rect,
20 gfx::Rect opaque_rect, 20 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 bool can_use_lcd_text) 24 bool can_use_lcd_text,
25 bool use_gpu_rasterizer)
25 : RefCountedManaged<Tile>(tile_manager), 26 : RefCountedManaged<Tile>(tile_manager),
26 tile_manager_(tile_manager), 27 tile_manager_(tile_manager),
27 tile_size_(tile_size), 28 tile_size_(tile_size),
28 content_rect_(content_rect), 29 content_rect_(content_rect),
29 contents_scale_(contents_scale), 30 contents_scale_(contents_scale),
30 opaque_rect_(opaque_rect), 31 opaque_rect_(opaque_rect),
31 layer_id_(layer_id), 32 layer_id_(layer_id),
32 source_frame_number_(source_frame_number), 33 source_frame_number_(source_frame_number),
33 can_use_lcd_text_(can_use_lcd_text), 34 can_use_lcd_text_(can_use_lcd_text),
35 use_gpu_rasterizer_(use_gpu_rasterizer),
34 id_(s_next_id_++) { 36 id_(s_next_id_++) {
35 set_picture_pile(picture_pile); 37 set_picture_pile(picture_pile);
36 } 38 }
37 39
38 Tile::~Tile() { 40 Tile::~Tile() {
39 TRACE_EVENT_OBJECT_DELETED_WITH_ID( 41 TRACE_EVENT_OBJECT_DELETED_WITH_ID(
40 TRACE_DISABLED_BY_DEFAULT("cc.debug"), 42 TRACE_DISABLED_BY_DEFAULT("cc.debug"),
41 "cc::Tile", this); 43 "cc::Tile", this);
42 } 44 }
43 45
(...skipping 30 matching lines...) Expand all
74 } 76 }
75 77
76 size_t Tile::GPUMemoryUsageInBytes() const { 78 size_t Tile::GPUMemoryUsageInBytes() const {
77 size_t total_size = 0; 79 size_t total_size = 0;
78 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) 80 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode)
79 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes(); 81 total_size += managed_state_.tile_versions[mode].GPUMemoryUsageInBytes();
80 return total_size; 82 return total_size;
81 } 83 }
82 84
83 } // namespace cc 85 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698