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

Side by Side Diff: cc/tiles/tile.h

Issue 1197423003: Remaining code for basic tile compression functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable tile compression for one copy Created 5 years, 6 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
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 #ifndef CC_TILES_TILE_H_ 5 #ifndef CC_TILES_TILE_H_
6 #define CC_TILES_TILE_H_ 6 #define CC_TILES_TILE_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "cc/tiles/tile_draw_info.h" 9 #include "cc/tiles/tile_draw_info.h"
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
11 #include "ui/gfx/geometry/size.h" 11 #include "ui/gfx/geometry/size.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 class PrioritizedTile; 15 class PrioritizedTile;
16 class TileManager; 16 class TileManager;
17 struct TilePriority; 17 struct TilePriority;
18 18
19 class CC_EXPORT Tile { 19 class CC_EXPORT Tile {
20 public: 20 public:
21 class CC_EXPORT Deleter { 21 class CC_EXPORT Deleter {
22 public: 22 public:
23 void operator()(Tile* tile) const; 23 void operator()(Tile* tile) const;
24 }; 24 };
25 25
26 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0 }; 26 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0, IS_OPAQUE = 1 << 1 };
27 27
28 typedef uint64 Id; 28 typedef uint64 Id;
29 29
30 Id id() const { 30 Id id() const {
31 return id_; 31 return id_;
32 } 32 }
33 33
34 // TODO(vmpstr): Move this to the iterators. 34 // TODO(vmpstr): Move this to the iterators.
35 bool required_for_activation() const { return required_for_activation_; } 35 bool required_for_activation() const { return required_for_activation_; }
36 void set_required_for_activation(bool is_required) { 36 void set_required_for_activation(bool is_required) {
37 required_for_activation_ = is_required; 37 required_for_activation_ = is_required;
38 } 38 }
39 bool required_for_draw() const { return required_for_draw_; } 39 bool required_for_draw() const { return required_for_draw_; }
40 void set_required_for_draw(bool is_required) { 40 void set_required_for_draw(bool is_required) {
41 required_for_draw_ = is_required; 41 required_for_draw_ = is_required;
42 } 42 }
43 43
44 bool use_picture_analysis() const { 44 bool use_picture_analysis() const {
45 return !!(flags_ & USE_PICTURE_ANALYSIS); 45 return !!(flags_ & USE_PICTURE_ANALYSIS);
46 } 46 }
47 47
48 bool is_opaque() const { return !!(flags_ & IS_OPAQUE); }
49
48 void AsValueInto(base::trace_event::TracedValue* value) const; 50 void AsValueInto(base::trace_event::TracedValue* value) const;
49 51
50 const TileDrawInfo& draw_info() const { return draw_info_; } 52 const TileDrawInfo& draw_info() const { return draw_info_; }
51 TileDrawInfo& draw_info() { return draw_info_; } 53 TileDrawInfo& draw_info() { return draw_info_; }
52 54
53 float contents_scale() const { return contents_scale_; } 55 float contents_scale() const { return contents_scale_; }
54 gfx::Rect content_rect() const { return content_rect_; } 56 gfx::Rect content_rect() const { return content_rect_; }
55 57
56 int layer_id() const { return layer_id_; } 58 int layer_id() const { return layer_id_; }
57 59
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 scoped_refptr<RasterTask> raster_task_; 127 scoped_refptr<RasterTask> raster_task_;
126 128
127 DISALLOW_COPY_AND_ASSIGN(Tile); 129 DISALLOW_COPY_AND_ASSIGN(Tile);
128 }; 130 };
129 131
130 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>; 132 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>;
131 133
132 } // namespace cc 134 } // namespace cc
133 135
134 #endif // CC_TILES_TILE_H_ 136 #endif // CC_TILES_TILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698