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

Unified Diff: cc/picture_pile_base.cc

Issue 12221077: Fixing tile grid size used by cc:Picture to make it respect current tile configuration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rolling skia to 7896 Created 7 years, 10 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
« no previous file with comments | « cc/picture_pile_base.h ('k') | cc/test/fake_content_layer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_pile_base.cc
diff --git a/cc/picture_pile_base.cc b/cc/picture_pile_base.cc
index 72e09d8603ad23d64f289f507e87eaf34b300f86..c855167faf96de3539a78eadb709e26c8d10066d 100644
--- a/cc/picture_pile_base.cc
+++ b/cc/picture_pile_base.cc
@@ -11,6 +11,7 @@ namespace {
// Dimensions of the tiles in this picture pile as well as the dimensions of
// the base picture in each tile.
const int kBasePictureSize = 3000;
+const int kTileGridBorderPixels = 1;
}
namespace cc {
@@ -18,6 +19,9 @@ namespace cc {
PicturePileBase::PicturePileBase()
: min_contents_scale_(0) {
tiling_.SetMaxTextureSize(gfx::Size(kBasePictureSize, kBasePictureSize));
+ tile_grid_info_.fTileInterval.setEmpty();
+ tile_grid_info_.fMargin.setEmpty();
+ tile_grid_info_.fOffset.setZero();
}
PicturePileBase::~PicturePileBase() {
@@ -68,6 +72,21 @@ void PicturePileBase::SetMinContentsScale(float min_contents_scale) {
min_contents_scale_ = min_contents_scale;
}
+void PicturePileBase::SetTileGridSize(const gfx::Size& tile_grid_size) {
+ tile_grid_info_.fTileInterval.set(
+ tile_grid_size.width() - 2 * kTileGridBorderPixels,
+ tile_grid_size.height() - 2 * kTileGridBorderPixels);
+ DCHECK_GT(tile_grid_info_.fTileInterval.width(), 0);
+ DCHECK_GT(tile_grid_info_.fTileInterval.height(), 0);
+ tile_grid_info_.fMargin.set(kTileGridBorderPixels,
+ kTileGridBorderPixels);
+ // Offset the tile grid coordinate space to take into account the fact
+ // that the top-most and left-most tiles do not have top and left borders
+ // respectively.
+ tile_grid_info_.fOffset.set(-kTileGridBorderPixels,
+ -kTileGridBorderPixels);
+}
+
void PicturePileBase::SetBufferPixels(int new_buffer_pixels) {
if (new_buffer_pixels == buffer_pixels())
return;
@@ -85,6 +104,7 @@ void PicturePileBase::PushPropertiesTo(PicturePileBase* other) {
other->tiling_ = tiling_;
other->recorded_region_ = recorded_region_;
other->min_contents_scale_ = min_contents_scale_;
+ other->tile_grid_info_ = tile_grid_info_;
}
void PicturePileBase::UpdateRecordedRegion() {
« no previous file with comments | « cc/picture_pile_base.h ('k') | cc/test/fake_content_layer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698