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

Side by Side Diff: cc/tile_drawing_info.h

Issue 12353003: cc: Refactored Tile::GetResourceId (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed forward declare Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_TILE_DRAWING_INFO_H_
6 #define CC_TILE_DRAWING_INFO_H_
7
8 #include "cc/resource_provider.h"
9 #include "cc/tile_manager.h"
10
11 namespace cc {
12
13 class Tile;
14
15 class CC_EXPORT TileDrawingInfo {
enne (OOO) 2013/02/27 22:13:57 I'm not really convinced that Tile is so complicat
16 public:
17 enum Mode {
18 TEXTURE_MODE,
19 SOLID_COLOR_MODE,
20 TRANSPARENT_MODE,
21 PICTURE_PILE_MODE,
22 NUM_MODES
23 };
24
25 TileDrawingInfo(const Tile* tile)
26 : mode_(TEXTURE_MODE),
27 tile_(tile) {}
28
29 Mode mode() const {
30 return mode_;
31 }
32
33 bool is_ready_to_draw() const;
enne (OOO) 2013/02/27 22:13:57 style nit: don't name functions using hacker_style
34
35 ResourceProvider::ResourceId get_resource_id() const;
enne (OOO) 2013/02/27 22:13:57 style nit: don't name functions using hacker_style
36
37 SkColor get_solid_color() const {
38 DCHECK(mode_ == SOLID_COLOR_MODE);
39
40 return solid_color_;
41 }
42
43 private:
44 friend class TileManager;
45
46 Mode mode_;
47 const Tile* tile_;
48 SkColor solid_color_;
49
50 void set_transparent();
51 void set_solid_color(const SkColor& color);
52 };
53
54 } // namespace cc
55
56 #endif // CC_TILE_DRAWING_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698