Chromium Code Reviews| Index: cc/resources/picture_layer_tiling.h |
| diff --git a/cc/resources/picture_layer_tiling.h b/cc/resources/picture_layer_tiling.h |
| index 108b922d3dcabf6aec41f9d35fe8563883cd250a..8fbd2495b6cc2ec0946ec03f4722fabb5edd35e1 100644 |
| --- a/cc/resources/picture_layer_tiling.h |
| +++ b/cc/resources/picture_layer_tiling.h |
| @@ -41,6 +41,8 @@ class CC_EXPORT PictureLayerTilingClient { |
| virtual size_t GetMaxTilesForInterestArea() const = 0; |
| virtual float GetSkewportTargetTimeInSeconds() const = 0; |
| virtual int GetSkewportExtrapolationLimitInContentPixels() const = 0; |
| + virtual WhichTree GetTree() const = 0; |
| + virtual bool RequiresHighResToDraw() const = 0; |
| protected: |
| virtual ~PictureLayerTilingClient() {} |
| @@ -73,6 +75,8 @@ class CC_EXPORT PictureLayerTiling { |
| private: |
| void AdvancePhase(); |
| bool TileNeedsRaster(Tile* tile) const { |
| + if (tile->is_occluded()) |
| + return false; |
| RasterMode mode = tile->DetermineRasterModeForTree(tree_); |
| return tile->NeedsRasterForMode(mode); |
| } |
| @@ -129,8 +133,6 @@ class CC_EXPORT PictureLayerTiling { |
| gfx::Size layer_bounds() const { return layer_bounds_; } |
| void SetLayerBounds(const gfx::Size& layer_bounds); |
| void Invalidate(const Region& layer_region); |
| - void RemoveTilesInRegion(const Region& layer_region); |
| - void CreateMissingTilesInLiveTilesRect(); |
| void SetClient(PictureLayerTilingClient* client); |
| void set_resolution(TileResolution resolution) { resolution_ = resolution; } |
| @@ -146,8 +148,29 @@ class CC_EXPORT PictureLayerTiling { |
| return (iter == tiles_.end()) ? NULL : iter->second.get(); |
| } |
| + Tile* GetOrCreateTileAt(int i, int j); |
| + |
| + void CreateInterestRectTilesForTesting() { |
| + for (TilingData::Iterator iter(&tiling_data_, live_tiles_rect_, true); iter; |
| + ++iter) { |
| + Tile* tile = GetOrCreateTileAt(iter.index_x(), iter.index_y()); |
| + if (tile) { |
| + UpdateTileOcclusion(tile); |
| + SetTilePriority(tile, true); |
| + } |
| + } |
| + } |
| + |
| void CreateAllTilesForTesting() { |
| SetLiveTilesRect(tiling_data_.tiling_rect()); |
| + for (TilingData::Iterator iter(&tiling_data_, live_tiles_rect_, true); iter; |
| + ++iter) { |
| + Tile* tile = GetOrCreateTileAt(iter.index_x(), iter.index_y()); |
| + if (tile) { |
| + UpdateTileOcclusion(tile); |
| + SetTilePriority(tile, true); |
| + } |
| + } |
| } |
| std::vector<Tile*> AllTilesForTesting() const { |
| @@ -223,13 +246,6 @@ class CC_EXPORT PictureLayerTiling { |
| // also updates the pile on each tile to be the current client's pile. |
| void DidBecomeActive(); |
| - // Resets the active priority for all tiles in a tiling, when an active |
| - // tiling is becoming recycled. This may include some tiles which are |
| - // not in the the pending tiling (due to invalidations). This must |
| - // be called before DidBecomeActive, as it resets the active priority |
| - // while DidBecomeActive promotes pending priority on a similar set of tiles. |
| - void DidBecomeRecycled(); |
| - |
| void UpdateTilesToCurrentPile(); |
| bool NeedsUpdateForFrameAtTime(double frame_time_in_seconds) { |
| @@ -272,6 +288,8 @@ class CC_EXPORT PictureLayerTiling { |
| PictureLayerTilingClient* client); |
| void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); |
| Tile* CreateTile(int i, int j, const PictureLayerTiling* twin_tiling); |
| + void UpdateTileOcclusion(Tile* tile); |
| + bool IsTileRequiredForActivation(Tile* tile) const; |
| // Computes a skewport. The calculation extrapolates the last visible |
| // rect and the current visible rect to expand the skewport to where it |
| @@ -284,6 +302,8 @@ class CC_EXPORT PictureLayerTiling { |
| void UpdateEvictionCacheIfNeeded(TreePriority tree_priority); |
| void DoInvalidate(const Region& layer_region, bool recreate_tiles); |
| + void SetTilePriority(Tile* tile, bool include_twin) const; |
| + |
| // Given properties. |
| float contents_scale_; |
| gfx::Size layer_bounds_; |
| @@ -295,9 +315,12 @@ class CC_EXPORT PictureLayerTiling { |
| TileMap tiles_; // It is not legal to have a NULL tile in the tiles_ map. |
| gfx::Rect live_tiles_rect_; |
| + base::hash_set<std::pair<int, int> > occlusion_set_; |
|
vmpstr
2014/07/02 23:51:29
The idea here is to just store indecies of occlude
|
| + |
| // State saved for computing velocities based upon finite differences. |
| double last_impl_frame_time_in_seconds_; |
| gfx::Rect last_visible_rect_in_content_space_; |
| + float content_to_screen_scale_; |
| gfx::Rect current_visible_rect_in_content_space_; |
| gfx::Rect current_skewport_; |
| @@ -305,8 +328,6 @@ class CC_EXPORT PictureLayerTiling { |
| gfx::Rect current_soon_border_rect_; |
| std::vector<Tile*> eviction_tiles_cache_; |
| - bool eviction_tiles_cache_valid_; |
| - TreePriority eviction_cache_tree_priority_; |
| private: |
| DISALLOW_ASSIGN(PictureLayerTiling); |