| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_RESOURCES_MANAGED_TILE_STATE_H_ | 5 #ifndef CC_RESOURCES_MANAGED_TILE_STATE_H_ |
| 6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_ | 6 #define CC_RESOURCES_MANAGED_TILE_STATE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/resources/platform_color.h" | 9 #include "cc/resources/platform_color.h" |
| 10 #include "cc/resources/resource_pool.h" | 10 #include "cc/resources/resource_pool.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 DCHECK(resource_); | 48 DCHECK(resource_); |
| 49 return !PlatformColor::SameComponentOrder(resource_->format()); | 49 return !PlatformColor::SameComponentOrder(resource_->format()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool requires_resource() const { | 52 bool requires_resource() const { |
| 53 return mode_ == RESOURCE_MODE || mode_ == PICTURE_PILE_MODE; | 53 return mode_ == RESOURCE_MODE || mode_ == PICTURE_PILE_MODE; |
| 54 } | 54 } |
| 55 | 55 |
| 56 inline bool has_resource() const { return !!resource_; } | 56 inline bool has_resource() const { return !!resource_; } |
| 57 | 57 |
| 58 inline bool has_compressed_resource() const { |
| 59 return resource_ ? IsFormatCompressed(resource_->format()) : false; |
| 60 } |
| 61 |
| 58 void SetSolidColorForTesting(SkColor color) { set_solid_color(color); } | 62 void SetSolidColorForTesting(SkColor color) { set_solid_color(color); } |
| 59 void SetResourceForTesting(scoped_ptr<ScopedResource> resource) { | 63 void SetResourceForTesting(scoped_ptr<ScopedResource> resource) { |
| 60 resource_ = resource.Pass(); | 64 resource_ = resource.Pass(); |
| 61 } | 65 } |
| 62 | 66 |
| 63 private: | 67 private: |
| 64 friend class TileManager; | 68 friend class TileManager; |
| 65 friend class PrioritizedTileSet; | 69 friend class PrioritizedTileSet; |
| 66 friend class Tile; | 70 friend class Tile; |
| 67 friend class ManagedTileState; | 71 friend class ManagedTileState; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 92 TileResolution resolution; | 96 TileResolution resolution; |
| 93 TilePriority::PriorityBin priority_bin; | 97 TilePriority::PriorityBin priority_bin; |
| 94 | 98 |
| 95 // Priority for this state from the last time we assigned memory. | 99 // Priority for this state from the last time we assigned memory. |
| 96 unsigned scheduled_priority; | 100 unsigned scheduled_priority; |
| 97 }; | 101 }; |
| 98 | 102 |
| 99 } // namespace cc | 103 } // namespace cc |
| 100 | 104 |
| 101 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ | 105 #endif // CC_RESOURCES_MANAGED_TILE_STATE_H_ |
| OLD | NEW |