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

Unified Diff: cc/resources/layer_tiling_data.cc

Issue 1144693002: cc: Move files out of cc/resources/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resources: android Created 5 years, 7 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/resources/layer_tiling_data.h ('k') | cc/resources/one_copy_tile_task_worker_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/layer_tiling_data.cc
diff --git a/cc/resources/layer_tiling_data.cc b/cc/resources/layer_tiling_data.cc
deleted file mode 100644
index 63b003628c346ae02898e785fb127fd7d3844de7..0000000000000000000000000000000000000000
--- a/cc/resources/layer_tiling_data.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2011 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/resources/layer_tiling_data.h"
-
-#include <vector>
-
-#include "base/logging.h"
-#include "cc/base/region.h"
-#include "cc/base/simple_enclosed_region.h"
-
-namespace cc {
-
-scoped_ptr<LayerTilingData> LayerTilingData::Create(const gfx::Size& tile_size,
- BorderTexelOption border) {
- return make_scoped_ptr(new LayerTilingData(tile_size, border));
-}
-
-LayerTilingData::LayerTilingData(const gfx::Size& tile_size,
- BorderTexelOption border)
- : tiling_data_(tile_size, gfx::Size(), border == HAS_BORDER_TEXELS) {
- SetTileSize(tile_size);
-}
-
-LayerTilingData::~LayerTilingData() {}
-
-void LayerTilingData::SetTileSize(const gfx::Size& size) {
- if (tile_size() == size)
- return;
-
- reset();
-
- tiling_data_.SetMaxTextureSize(size);
-}
-
-gfx::Size LayerTilingData::tile_size() const {
- return tiling_data_.max_texture_size();
-}
-
-void LayerTilingData::SetBorderTexelOption(
- BorderTexelOption border_texel_option) {
- bool border_texels = border_texel_option == HAS_BORDER_TEXELS;
- if (has_border_texels() == border_texels)
- return;
-
- reset();
- tiling_data_.SetHasBorderTexels(border_texels);
-}
-
-const LayerTilingData& LayerTilingData::operator=
- (const LayerTilingData & tiler) {
- tiling_data_ = tiler.tiling_data_;
-
- return *this;
-}
-
-void LayerTilingData::AddTile(scoped_ptr<Tile> tile, int i, int j) {
- DCHECK(!TileAt(i, j));
- tile->move_to(i, j);
- tiles_.add(std::make_pair(i, j), tile.Pass());
-}
-
-scoped_ptr<LayerTilingData::Tile> LayerTilingData::TakeTile(int i, int j) {
- return tiles_.take_and_erase(std::make_pair(i, j));
-}
-
-LayerTilingData::Tile* LayerTilingData::TileAt(int i, int j) const {
- return tiles_.get(std::make_pair(i, j));
-}
-
-void LayerTilingData::ContentRectToTileIndices(const gfx::Rect& content_rect,
- int* left,
- int* top,
- int* right,
- int* bottom) const {
- // An empty rect doesn't result in an empty set of tiles, so don't pass an
- // empty rect.
- // TODO(enne): Possibly we should fill a vector of tiles instead, since the
- // normal use of this function is to enumerate some tiles.
- DCHECK(!content_rect.IsEmpty());
-
- *left = tiling_data_.TileXIndexFromSrcCoord(content_rect.x());
- *top = tiling_data_.TileYIndexFromSrcCoord(content_rect.y());
- *right = tiling_data_.TileXIndexFromSrcCoord(content_rect.right() - 1);
- *bottom = tiling_data_.TileYIndexFromSrcCoord(content_rect.bottom() - 1);
-}
-
-gfx::Rect LayerTilingData::TileRect(const Tile* tile) const {
- gfx::Rect tile_rect = tiling_data_.TileBoundsWithBorder(tile->i(), tile->j());
- tile_rect.set_size(tile_size());
- return tile_rect;
-}
-
-void LayerTilingData::SetTilingSize(const gfx::Size& tiling_size) {
- tiling_data_.SetTilingSize(tiling_size);
- if (tiling_size.IsEmpty()) {
- tiles_.clear();
- return;
- }
-
- // Any tiles completely outside our new bounds are invalid and should be
- // dropped.
- int left, top, right, bottom;
- ContentRectToTileIndices(
- gfx::Rect(tiling_size), &left, &top, &right, &bottom);
- std::vector<TileMapKey> invalid_tile_keys;
- for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
- if (it->first.first > right || it->first.second > bottom)
- invalid_tile_keys.push_back(it->first);
- }
- for (size_t i = 0; i < invalid_tile_keys.size(); ++i)
- tiles_.erase(invalid_tile_keys[i]);
-}
-
-} // namespace cc
« no previous file with comments | « cc/resources/layer_tiling_data.h ('k') | cc/resources/one_copy_tile_task_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698