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

Unified Diff: cc/test/fake_picture_pile.cc

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.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_picture_pile.h ('k') | cc/test/fake_picture_pile_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_picture_pile.cc
diff --git a/cc/test/fake_picture_pile.cc b/cc/test/fake_picture_pile.cc
deleted file mode 100644
index 4db6c58a8345dacb1e7a1489724867af4810fa3f..0000000000000000000000000000000000000000
--- a/cc/test/fake_picture_pile.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2014 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.
-
-#include "cc/test/fake_picture_pile.h"
-
-#include <utility>
-
-#include "cc/test/fake_picture_pile_impl.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace cc {
-
-namespace {
-
-scoped_ptr<FakePicturePile> CreatePile(const gfx::Size& tile_size,
- const gfx::Size& layer_bounds,
- bool is_filled) {
- scoped_ptr<FakePicturePile> pile(
- new FakePicturePile(ImplSidePaintingSettings().minimum_contents_scale,
- ImplSidePaintingSettings().default_tile_grid_size));
- pile->tiling().SetBorderTexels(0);
- pile->tiling().SetTilingSize(layer_bounds);
- pile->tiling().SetMaxTextureSize(tile_size);
- pile->SetRecordedViewport(is_filled ? gfx::Rect(layer_bounds) : gfx::Rect());
- pile->SetHasAnyRecordings(is_filled);
- if (is_filled) {
- for (int x = 0; x < pile->tiling().num_tiles_x(); ++x) {
- for (int y = 0; y < pile->tiling().num_tiles_y(); ++y)
- pile->AddRecordingAt(x, y);
- }
- }
- return pile;
-}
-
-} // namespace
-
-scoped_ptr<FakePicturePile> FakePicturePile::CreateFilledPile(
- const gfx::Size& tile_size,
- const gfx::Size& layer_bounds) {
- bool is_filled = true;
- return CreatePile(tile_size, layer_bounds, is_filled);
-}
-
-scoped_ptr<FakePicturePile> FakePicturePile::CreateEmptyPile(
- const gfx::Size& tile_size,
- const gfx::Size& layer_bounds) {
- bool is_filled = false;
- return CreatePile(tile_size, layer_bounds, is_filled);
-}
-
-scoped_refptr<RasterSource> FakePicturePile::CreateRasterSource(
- bool can_use_lcd_text) const {
- return FakePicturePileImpl::CreateFromPile(this, playback_allowed_event_);
-}
-
-void FakePicturePile::AddRecordingAt(int x, int y) {
- EXPECT_GE(x, 0);
- EXPECT_GE(y, 0);
- EXPECT_LT(x, tiling_.num_tiles_x());
- EXPECT_LT(y, tiling_.num_tiles_y());
-
- if (HasRecordingAt(x, y))
- return;
- gfx::Rect bounds(tiling().TileBounds(x, y));
- bounds.Inset(-buffer_pixels(), -buffer_pixels());
-
- scoped_refptr<Picture> picture(
- Picture::Create(bounds, &client_, tile_grid_size_, true,
- RecordingSource::RECORD_NORMALLY));
- picture_map_[std::pair<int, int>(x, y)].SetPicture(picture);
- EXPECT_TRUE(HasRecordingAt(x, y));
-
- has_any_recordings_ = true;
-}
-
-void FakePicturePile::RemoveRecordingAt(int x, int y) {
- EXPECT_GE(x, 0);
- EXPECT_GE(y, 0);
- EXPECT_LT(x, tiling_.num_tiles_x());
- EXPECT_LT(y, tiling_.num_tiles_y());
-
- if (!HasRecordingAt(x, y))
- return;
- picture_map_.erase(std::pair<int, int>(x, y));
- EXPECT_FALSE(HasRecordingAt(x, y));
-}
-
-bool FakePicturePile::HasRecordingAt(int x, int y) const {
- PictureMap::const_iterator found = picture_map_.find(PictureMapKey(x, y));
- if (found == picture_map_.end())
- return false;
- return !!found->second.GetPicture();
-}
-
-void FakePicturePile::RerecordPile() {
- for (int y = 0; y < num_tiles_y(); ++y) {
- for (int x = 0; x < num_tiles_x(); ++x) {
- RemoveRecordingAt(x, y);
- AddRecordingAt(x, y);
- }
- }
-}
-
-} // namespace cc
« no previous file with comments | « cc/test/fake_picture_pile.h ('k') | cc/test/fake_picture_pile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698