In iossim, ignore harmless messages from launchd.
[chromium-blink-merge.git] / cc / tile.h
blob51c61b7bf0beb3a53b9ed90845ed040257e194fa
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
3 // found in the LICENSE file.
5 #ifndef CC_TILE_H_
6 #define CC_TILE_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h"
11 #include "cc/layer_tree_host_impl.h"
12 #include "cc/picture_pile_impl.h"
13 #include "cc/resource_provider.h"
14 #include "cc/tile_manager.h"
15 #include "cc/tile_priority.h"
16 #include "ui/gfx/rect.h"
17 #include "ui/gfx/size.h"
19 namespace cc {
21 class Tile;
23 class CC_EXPORT Tile : public base::RefCounted<Tile> {
24 public:
25 Tile(TileManager* tile_manager,
26 PicturePileImpl* picture_pile,
27 gfx::Size tile_size,
28 GLenum format,
29 gfx::Rect content_rect,
30 float contents_scale);
32 PicturePileImpl* picture_pile() {
33 return picture_pile_.get();
36 const TilePriority& priority(WhichTree tree) const {
37 return priority_[tree];
40 TilePriority combined_priority() const {
41 return TilePriority(priority_[ACTIVE_TREE],
42 priority_[PENDING_TREE]);
45 void set_priority(WhichTree tree, const TilePriority& priority);
47 // Returns 0 if not drawable.
48 ResourceProvider::ResourceId GetResourceId() const;
50 const gfx::Rect& opaque_rect() const { return opaque_rect_; }
52 bool contents_swizzled() const { return managed_state_.contents_swizzled; }
54 private:
55 // Methods called by by tile manager.
56 friend class TileManager;
57 friend class BinComparator;
58 ManagedTileState& managed_state() { return managed_state_; }
59 const ManagedTileState& managed_state() const { return managed_state_; }
60 size_t bytes_consumed_if_allocated() const;
61 float contents_scale() const { return contents_scale_; }
63 // Normal private methods.
64 friend class base::RefCounted<Tile>;
65 ~Tile();
67 TileManager* tile_manager_;
68 scoped_refptr<PicturePileImpl> picture_pile_;
69 gfx::Rect tile_size_;
70 GLenum format_;
71 gfx::Rect content_rect_;
72 float contents_scale_;
73 gfx::Rect opaque_rect_;
75 TilePriority priority_[2];
76 ManagedTileState managed_state_;
79 } // namespace cc
81 #endif // CC_TILE_H_