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

Unified Diff: cc/test/fake_display_list_recording_source.h

Issue 1047413003: Revert of Implement DisplayList GatherPixelRefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/test/fake_content_layer_client.cc ('k') | cc/test/fake_picture_pile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_display_list_recording_source.h
diff --git a/cc/test/fake_display_list_recording_source.h b/cc/test/fake_display_list_recording_source.h
deleted file mode 100644
index b9a15f327884e455d3fd7f876b283378a501360a..0000000000000000000000000000000000000000
--- a/cc/test/fake_display_list_recording_source.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_TEST_FAKE_DISPLAY_LIST_RECORDING_SOURCE_H_
-#define CC_TEST_FAKE_DISPLAY_LIST_RECORDING_SOURCE_H_
-
-#include "cc/resources/display_list_recording_source.h"
-#include "cc/test/fake_content_layer_client.h"
-#include "cc/test/impl_side_painting_settings.h"
-
-namespace cc {
-
-// This class provides method for test to add bitmap and draw rect to content
-// layer client. This class also provides function to rerecord to generate a new
-// display list.
-class FakeDisplayListRecordingSource : public DisplayListRecordingSource {
- public:
- explicit FakeDisplayListRecordingSource(const gfx::Size& grid_cell_size)
- : DisplayListRecordingSource(grid_cell_size) {}
- ~FakeDisplayListRecordingSource() override {}
-
- static scoped_ptr<FakeDisplayListRecordingSource> CreateRecordingSource(
- const gfx::Rect& recorded_viewport) {
- scoped_ptr<FakeDisplayListRecordingSource> recording_source(
- new FakeDisplayListRecordingSource(
- ImplSidePaintingSettings().default_tile_grid_size));
- recording_source->SetRecordedViewport(recorded_viewport);
- return recording_source;
- }
-
- void SetRecordedViewport(const gfx::Rect& recorded_viewport) {
- recorded_viewport_ = recorded_viewport;
- }
-
- void SetGridCellSize(const gfx::Size& grid_cell_size) {
- grid_cell_size_ = grid_cell_size;
- }
-
- void Rerecord() {
- ContentLayerClient::PaintingControlSetting painting_control =
- ContentLayerClient::PAINTING_BEHAVIOR_NORMAL;
- display_list_ = client_.PaintContentsToDisplayList(recorded_viewport_,
- painting_control);
- display_list_->set_layer_rect(recorded_viewport_);
- display_list_->CreateAndCacheSkPicture();
- display_list_->GatherPixelRefs(grid_cell_size_);
- }
-
- void add_draw_rect(const gfx::RectF& rect) {
- client_.add_draw_rect(rect, default_paint_);
- }
-
- void add_draw_rect_with_paint(const gfx::RectF& rect, const SkPaint& paint) {
- client_.add_draw_rect(rect, paint);
- }
-
- void add_draw_bitmap(const SkBitmap& bitmap, const gfx::Point& point) {
- client_.add_draw_bitmap(bitmap, point, default_paint_);
- }
-
- void add_draw_bitmap_with_transform(const SkBitmap& bitmap,
- const gfx::Transform& transform) {
- client_.add_draw_bitmap_with_transform(bitmap, transform, default_paint_);
- }
-
- void add_draw_bitmap_with_paint(const SkBitmap& bitmap,
- const gfx::Point& point,
- const SkPaint& paint) {
- client_.add_draw_bitmap(bitmap, point, paint);
- }
-
- void add_draw_bitmap_with_paint_and_transform(const SkBitmap& bitmap,
- const gfx::Transform& transform,
- const SkPaint& paint) {
- client_.add_draw_bitmap_with_transform(bitmap, transform, paint);
- }
-
- void set_default_paint(const SkPaint& paint) { default_paint_ = paint; }
-
- private:
- FakeContentLayerClient client_;
- SkPaint default_paint_;
-};
-
-} // namespace cc
-
-#endif // CC_TEST_FAKE_DISPLAY_LIST_RECORDING_SOURCE_H_
« no previous file with comments | « cc/test/fake_content_layer_client.cc ('k') | cc/test/fake_picture_pile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698