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

Unified Diff: cc/test/fake_picture_pile_impl.cc

Issue 671653005: SetNeedsRedraw directly when updating a visible tile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pinchblurmerge-test: rebase-on-picture-pile-base-removal Created 6 years, 1 month 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/test/fake_picture_pile_impl.cc
diff --git a/cc/test/fake_picture_pile_impl.cc b/cc/test/fake_picture_pile_impl.cc
index 3d31c12a0f65864e7f748d0cac6bb971de05051a..23b78ca362c91a314bf843aadd5f100411c5569f 100644
--- a/cc/test/fake_picture_pile_impl.cc
+++ b/cc/test/fake_picture_pile_impl.cc
@@ -11,14 +11,18 @@
#include "cc/resources/picture_pile.h"
#include "cc/test/fake_picture_pile.h"
#include "cc/test/impl_side_painting_settings.h"
+#include "cc/test/thread_blocker.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
-FakePicturePileImpl::FakePicturePileImpl() {}
+FakePicturePileImpl::FakePicturePileImpl() : raster_thread_blocker_(nullptr) {
+}
-FakePicturePileImpl::FakePicturePileImpl(const PicturePile* other)
+FakePicturePileImpl::FakePicturePileImpl(const PicturePile* other,
+ ThreadBlocker* blocker)
: PicturePileImpl(other),
+ raster_thread_blocker_(blocker),
tile_grid_info_(other->GetTileGridInfoForTesting()) {
}
@@ -34,7 +38,7 @@ scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile(
pile.SetRecordedViewport(gfx::Rect(layer_bounds));
pile.SetHasAnyRecordings(true);
- auto pile_impl = make_scoped_refptr(new FakePicturePileImpl(&pile));
+ auto pile_impl = make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr));
for (int x = 0; x < pile_impl->tiling().num_tiles_x(); ++x) {
for (int y = 0; y < pile_impl->tiling().num_tiles_y(); ++y)
pile_impl->AddRecordingAt(x, y);
@@ -51,7 +55,7 @@ scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateEmptyPile(
pile.SetTileGridSize(ImplSidePaintingSettings().default_tile_grid_size);
pile.SetRecordedViewport(gfx::Rect());
pile.SetHasAnyRecordings(false);
- return make_scoped_refptr(new FakePicturePileImpl(&pile));
+ return make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr));
}
scoped_refptr<FakePicturePileImpl>
@@ -65,7 +69,7 @@ FakePicturePileImpl::CreateEmptyPileThatThinksItHasRecordings(
// This simulates a false positive for this flag.
pile.SetRecordedViewport(gfx::Rect());
pile.SetHasAnyRecordings(true);
- return make_scoped_refptr(new FakePicturePileImpl(&pile));
+ return make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr));
}
scoped_refptr<FakePicturePileImpl>
@@ -79,11 +83,25 @@ FakePicturePileImpl::CreateInfiniteFilledPile() {
pile.SetRecordedViewport(gfx::Rect(size));
pile.SetHasAnyRecordings(true);
- auto pile_impl = make_scoped_refptr(new FakePicturePileImpl(&pile));
+ auto pile_impl = make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr));
pile_impl->AddRecordingAt(0, 0);
return pile_impl;
}
+scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFromPile(
+ const PicturePile* other,
+ ThreadBlocker* blocker) {
+ return make_scoped_refptr(new FakePicturePileImpl(other, blocker));
+}
+
+void FakePicturePileImpl::PlaybackToCanvas(SkCanvas* canvas,
+ const gfx::Rect& canvas_rect,
+ float contents_scale) const {
+ PicturePileImpl::PlaybackToCanvas(canvas, canvas_rect, contents_scale);
+ if (raster_thread_blocker_)
+ raster_thread_blocker_->Wait();
+}
+
void FakePicturePileImpl::AddRecordingAt(int x, int y) {
EXPECT_GE(x, 0);
EXPECT_GE(y, 0);

Powered by Google App Engine
This is Rietveld 408576698