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

Unified Diff: cc/test/fake_picture_pile_impl.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_impl.h ('k') | cc/test/fake_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
deleted file mode 100644
index ab255cc2eef60e24deb8e4690c71fe684ce5cf57..0000000000000000000000000000000000000000
--- a/cc/test/fake_picture_pile_impl.cc
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2013 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_impl.h"
-
-#include <algorithm>
-#include <limits>
-#include <utility>
-
-#include "base/synchronization/waitable_event.h"
-#include "cc/resources/picture_pile.h"
-#include "cc/test/impl_side_painting_settings.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace cc {
-
-FakePicturePileImpl::FakePicturePileImpl() : playback_allowed_event_(nullptr) {
-}
-
-FakePicturePileImpl::FakePicturePileImpl(
- const PicturePile* other,
- base::WaitableEvent* playback_allowed_event)
- : PicturePileImpl(other, true),
- playback_allowed_event_(playback_allowed_event),
- tile_grid_size_(other->GetTileGridSizeForTesting()) {
-}
-
-FakePicturePileImpl::~FakePicturePileImpl() {}
-
-scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreatePile(
- const gfx::Size& tile_size,
- const gfx::Size& layer_bounds,
- bool is_filled) {
- FakePicturePile pile(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);
- }
- }
- scoped_refptr<FakePicturePileImpl> pile_impl(
- new FakePicturePileImpl(&pile, nullptr));
- return pile_impl;
-}
-
-scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile(
- const gfx::Size& tile_size,
- const gfx::Size& layer_bounds) {
- bool is_filled = true;
- return CreatePile(tile_size, layer_bounds, is_filled);
-}
-
-scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::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<FakePicturePileImpl>
-FakePicturePileImpl::CreateEmptyPileThatThinksItHasRecordings(
- const gfx::Size& tile_size,
- const gfx::Size& layer_bounds,
- bool is_solid_color) {
- FakePicturePile pile(ImplSidePaintingSettings().minimum_contents_scale,
- ImplSidePaintingSettings().default_tile_grid_size);
- pile.tiling().SetBorderTexels(0);
- pile.tiling().SetTilingSize(layer_bounds);
- pile.tiling().SetMaxTextureSize(tile_size);
- // This simulates a false positive for this flag.
- pile.SetRecordedViewport(gfx::Rect());
- pile.SetHasAnyRecordings(true);
- pile.SetIsSolidColor(is_solid_color);
- return make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr));
-}
-
-scoped_refptr<FakePicturePileImpl>
-FakePicturePileImpl::CreateInfiniteFilledPile() {
- gfx::Size size(std::numeric_limits<int>::max(),
- std::numeric_limits<int>::max());
- FakePicturePile pile(ImplSidePaintingSettings().minimum_contents_scale, size);
- pile.tiling().SetBorderTexels(0);
- pile.tiling().SetTilingSize(size);
- pile.tiling().SetMaxTextureSize(size);
- pile.SetRecordedViewport(gfx::Rect(size));
- pile.SetHasAnyRecordings(true);
- pile.AddRecordingAt(0, 0);
- scoped_refptr<FakePicturePileImpl> pile_impl(
- new FakePicturePileImpl(&pile, nullptr));
- return pile_impl;
-}
-
-scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFromPile(
- const PicturePile* other,
- base::WaitableEvent* playback_allowed_event) {
- return make_scoped_refptr(
- new FakePicturePileImpl(other, playback_allowed_event));
-}
-
-void FakePicturePileImpl::PlaybackToCanvas(SkCanvas* canvas,
- const gfx::Rect& canvas_rect,
- float contents_scale) const {
- if (playback_allowed_event_)
- playback_allowed_event_->Wait();
- PicturePileImpl::PlaybackToCanvas(canvas, canvas_rect, contents_scale);
-}
-
-bool FakePicturePileImpl::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();
-}
-
-} // namespace cc
« no previous file with comments | « cc/test/fake_picture_pile_impl.h ('k') | cc/test/fake_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698