Chromium Code Reviews| Index: cc/resources/tiling_set_raster_queue_required.h |
| diff --git a/cc/resources/tiling_set_raster_queue_required.h b/cc/resources/tiling_set_raster_queue_required.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..774c46323de2fdb2fa3e3996f97ec8e3aab68606 |
| --- /dev/null |
| +++ b/cc/resources/tiling_set_raster_queue_required.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CC_RESOURCES_TILING_SET_RASTER_QUEUE_REQUIRED_H_ |
| +#define CC_RESOURCES_TILING_SET_RASTER_QUEUE_REQUIRED_H_ |
| + |
| +#include "cc/base/cc_export.h" |
| +#include "cc/resources/picture_layer_tiling_set.h" |
| +#include "cc/resources/raster_tile_priority_queue.h" |
| +#include "cc/resources/tile.h" |
| +#include "cc/resources/tiling_set_raster_queue.h" |
| + |
| +namespace cc { |
| + |
| +// This queue only returns tiles that are required for either activation or |
| +// draw, as specified by RasterTilePriorityQueue::Type passed in the |
| +// constructor. |
| +class CC_EXPORT TilingSetRasterQueueRequired : public TilingSetRasterQueue { |
| + public: |
| + TilingSetRasterQueueRequired(PictureLayerTilingSet* tiling_set, |
| + RasterTilePriorityQueue::Type type); |
| + ~TilingSetRasterQueueRequired() override; |
| + |
| + Tile* Top() override; |
| + const Tile* Top() const override; |
| + void Pop() override; |
| + bool IsEmpty() const override; |
| + |
| + private: |
| + class TilingIterator { |
| + public: |
| + TilingIterator(); |
| + explicit TilingIterator(PictureLayerTiling* tiling, |
| + TilingData* tiling_data); |
| + ~TilingIterator(); |
| + |
| + operator bool() const { return !!current_tile_; } |
|
danakj
2015/01/08 23:24:41
should this be an operator comparablethingthatisnt
vmpstr
2015/01/09 20:21:41
Can you elaborate? I'm not sure I understand your
danakj
2015/01/09 20:28:22
I mean like this https://code.google.com/p/chromiu
vmpstr
2015/01/09 20:52:42
Hmm. Not really a fan from the clean code perspect
vmpstr
2015/01/10 01:44:55
After some discussion, I've decided to just go wit
|
| + const Tile* operator*() const { return current_tile_; } |
| + Tile* operator*() { return current_tile_; } |
| + TilingIterator& operator++(); |
| + |
| + private: |
| + bool TileNeedsRaster(Tile* tile) const { |
| + return tile->NeedsRaster() && !tiling_->IsTileOccluded(tile); |
| + } |
| + |
| + PictureLayerTiling* tiling_; |
| + TilingData* tiling_data_; |
| + |
| + Tile* current_tile_; |
| + TilingData::Iterator visible_iterator_; |
| + }; |
| + |
| + bool IsTileRequired(const Tile* tile) const; |
| + |
| + TilingIterator iterator_; |
| + RasterTilePriorityQueue::Type type_; |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_RESOURCES_TILING_SET_RASTER_QUEUE_REQUIRED_H_ |