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

Unified Diff: cc/tiles/picture_layer_tiling.h

Issue 2175553002: Raster PictureLayerTiling with fractional translation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: cc/tiles/picture_layer_tiling.h
diff --git a/cc/tiles/picture_layer_tiling.h b/cc/tiles/picture_layer_tiling.h
index fcd06ace8cd20025ba207cfd4e22593ac392a40c..5362a071dcc2a243121ad13dcd205f6d4a26be86 100644
--- a/cc/tiles/picture_layer_tiling.h
+++ b/cc/tiles/picture_layer_tiling.h
@@ -17,6 +17,7 @@
#include "base/macros.h"
#include "cc/base/cc_export.h"
#include "cc/base/region.h"
+#include "cc/base/scale_translate2d.h"
#include "cc/base/tiling_data.h"
#include "cc/tiles/tile.h"
#include "cc/tiles/tile_priority.h"
@@ -81,7 +82,7 @@ class CC_EXPORT PictureLayerTiling {
static const int kBorderTexels = 1;
PictureLayerTiling(WhichTree tree,
- float contents_scale,
+ const ScaleTranslate2d& contents_transform,
scoped_refptr<RasterSource> raster_source,
PictureLayerTilingClient* client);
~PictureLayerTiling();
@@ -118,7 +119,10 @@ class CC_EXPORT PictureLayerTiling {
gfx::Size tiling_size() const { return tiling_data_.tiling_size(); }
gfx::Rect live_tiles_rect() const { return live_tiles_rect_; }
gfx::Size tile_size() const { return tiling_data_.max_texture_size(); }
- float contents_scale() const { return contents_scale_; }
+ // float contents_scale() const { return contents_scale_; }
+ const ScaleTranslate2d& contents_transform() const {
+ return contents_transform_;
+ }
const TilingData* tiling_data() const { return &tiling_data_; }
Tile* TileAt(int i, int j) const {
@@ -163,7 +167,7 @@ class CC_EXPORT PictureLayerTiling {
void SetAllTilesOccludedForTesting() {
gfx::Rect viewport_in_layer_space =
- ScaleToEnclosingRect(current_visible_rect_, 1.0f / contents_scale_);
+ EnclosingLayerRectFromContentsRect(current_visible_rect_);
current_occlusion_in_layer_space_ =
Occlusion(gfx::Transform(),
SimpleEnclosedRegion(viewport_in_layer_space),
@@ -211,7 +215,7 @@ class CC_EXPORT PictureLayerTiling {
private:
const PictureLayerTiling* tiling_;
gfx::Rect dest_rect_;
- float dest_to_content_scale_;
+ ScaleTranslate2d dest_to_content_;
Tile* current_tile_;
gfx::Rect current_geometry_rect_;
@@ -319,8 +323,13 @@ class CC_EXPORT PictureLayerTiling {
}
void RemoveTilesInRegion(const Region& layer_region, bool recreate_tiles);
+ gfx::Rect EnclosingContentsRectFromLayerRect(
+ const gfx::Rect& layer_rect) const;
+ gfx::Rect EnclosingLayerRectFromContentsRect(
+ const gfx::Rect& contents_rect) const;
+
// Given properties.
- const float contents_scale_;
+ const ScaleTranslate2d contents_transform_;
PictureLayerTilingClient* const client_;
const WhichTree tree_;
scoped_refptr<RasterSource> raster_source_;

Powered by Google App Engine
This is Rietveld 408576698