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

Unified Diff: cc/layers/tiled_layer_unittest.cc

Issue 315393002: Record SkPicture with correct LCD text setting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better unittest Created 6 years, 6 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/layers/tiled_layer_unittest.cc
diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc
index bd15f2f1f540d62dde876158a33b591f86d16e46..72c5498105591e6c54badb42c6104f07eeb8856b 100644
--- a/cc/layers/tiled_layer_unittest.cc
+++ b/cc/layers/tiled_layer_unittest.cc
@@ -9,7 +9,7 @@
#include "base/run_loop.h"
#include "cc/resources/bitmap_content_layer_updater.h"
-#include "cc/resources/layer_painter.h"
+#include "cc/resources/content_layer_painter.h"
#include "cc/resources/prioritized_resource_manager.h"
#include "cc/resources/resource_update_controller.h"
#include "cc/test/animation_test_common.h"
@@ -1699,14 +1699,15 @@ TEST_F(TiledLayerTest, DontAllocateContentsWhenTargetSurfaceCantBeAllocated) {
layer_tree_host_->SetRootLayer(NULL);
}
-class TrackingLayerPainter : public LayerPainter {
+class TrackingLayerPainter : public ContentLayerPainter {
public:
- static scoped_ptr<TrackingLayerPainter> Create() {
- return make_scoped_ptr(new TrackingLayerPainter());
+ static scoped_ptr<TrackingLayerPainter> Create(ContentLayerClient* client) {
+ return make_scoped_ptr(new TrackingLayerPainter(client));
}
virtual void Paint(SkCanvas* canvas,
const gfx::Rect& content_rect,
+ bool can_paint_lcd_text,
gfx::RectF* opaque) OVERRIDE {
painted_rect_ = content_rect;
}
@@ -1714,6 +1715,10 @@ class TrackingLayerPainter : public LayerPainter {
gfx::Rect PaintedRect() const { return painted_rect_; }
void ResetPaintedRect() { painted_rect_ = gfx::Rect(); }
+ protected:
+ explicit TrackingLayerPainter(ContentLayerClient* client)
+ : ContentLayerPainter(client) {}
+
private:
gfx::Rect painted_rect_;
};
@@ -1722,12 +1727,11 @@ class UpdateTrackingTiledLayer : public FakeTiledLayer {
public:
explicit UpdateTrackingTiledLayer(PrioritizedResourceManager* manager)
: FakeTiledLayer(manager) {
- scoped_ptr<TrackingLayerPainter> painter(TrackingLayerPainter::Create());
+ scoped_ptr<TrackingLayerPainter> painter(
+ TrackingLayerPainter::Create(NULL));
tracking_layer_painter_ = painter.get();
- layer_updater_ =
- BitmapContentLayerUpdater::Create(painter.PassAs<LayerPainter>(),
- &stats_instrumentation_,
- 0);
+ layer_updater_ = BitmapContentLayerUpdater::Create(
+ painter.PassAs<ContentLayerPainter>(), &stats_instrumentation_, 0);
}
TrackingLayerPainter* tracking_layer_painter() const {

Powered by Google App Engine
This is Rietveld 408576698