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

Unified Diff: cc/layer_tiling_data.h

Issue 12471007: Part 8 of cc/ directory shuffles: resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/layer_quad_unittest.cc ('k') | cc/layer_tiling_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tiling_data.h
diff --git a/cc/layer_tiling_data.h b/cc/layer_tiling_data.h
deleted file mode 100644
index a00fb46dea80166aa336459d232b2fe1b73bda67..0000000000000000000000000000000000000000
--- a/cc/layer_tiling_data.h
+++ /dev/null
@@ -1,105 +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.
-
-#ifndef CC_LAYER_TILING_DATA_H_
-#define CC_LAYER_TILING_DATA_H_
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-#include "cc/base/cc_export.h"
-#include "cc/base/hash_pair.h"
-#include "cc/base/region.h"
-#include "cc/base/scoped_ptr_hash_map.h"
-#include "cc/base/tiling_data.h"
-#include "ui/gfx/rect.h"
-
-namespace cc {
-
-class CC_EXPORT LayerTilingData {
- public:
- enum BorderTexelOption {
- HAS_BORDER_TEXELS,
- NO_BORDER_TEXELS
- };
-
- ~LayerTilingData();
-
- static scoped_ptr<LayerTilingData> Create(gfx::Size tile_size,
- BorderTexelOption option);
-
- bool has_empty_bounds() const { return tiling_data_.has_empty_bounds(); }
- int num_tiles_x() const { return tiling_data_.num_tiles_x(); }
- int num_tiles_y() const { return tiling_data_.num_tiles_y(); }
- gfx::Rect tile_bounds(int i, int j) const {
- return tiling_data_.TileBounds(i, j);
- }
- gfx::Vector2d texture_offset(int x_index, int y_index) const {
- return tiling_data_.TextureOffset(x_index, y_index);
- }
-
- // Change the tile size. This may invalidate all the existing tiles.
- void SetTileSize(gfx::Size size);
- gfx::Size tile_size() const;
- // Change the border texel setting. This may invalidate all existing tiles.
- void SetBorderTexelOption(BorderTexelOption option);
- bool has_border_texels() const { return !!tiling_data_.border_texels(); }
-
- bool is_empty() const { return has_empty_bounds() || !tiles().size(); }
-
- const LayerTilingData& operator=(const LayerTilingData&);
-
- class Tile {
- public:
- Tile() : i_(-1), j_(-1) {}
- virtual ~Tile() {}
-
- int i() const { return i_; }
- int j() const { return j_; }
- void move_to(int i, int j) {
- i_ = i;
- j_ = j;
- }
-
- gfx::Rect opaque_rect() const { return opaque_rect_; }
- void set_opaque_rect(gfx::Rect opaque_rect) { opaque_rect_ = opaque_rect; }
- private:
- int i_;
- int j_;
- gfx::Rect opaque_rect_;
- DISALLOW_COPY_AND_ASSIGN(Tile);
- };
- typedef std::pair<int, int> TileMapKey;
- typedef ScopedPtrHashMap<TileMapKey, Tile> TileMap;
-
- void AddTile(scoped_ptr<Tile> tile, int i, int j);
- scoped_ptr<Tile> TakeTile(int i, int j);
- Tile* TileAt(int i, int j) const;
- const TileMap& tiles() const { return tiles_; }
-
- void SetBounds(gfx::Size size);
- gfx::Size bounds() const { return tiling_data_.total_size(); }
-
- void ContentRectToTileIndices(gfx::Rect rect,
- int* left,
- int* top,
- int* right,
- int* bottom) const;
- gfx::Rect TileRect(const Tile* tile) const;
-
- Region OpaqueRegionInContentRect(gfx::Rect rect) const;
-
- void reset() { tiles_.clear(); }
-
- protected:
- LayerTilingData(gfx::Size tile_size, BorderTexelOption option);
-
- TileMap tiles_;
- TilingData tiling_data_;
-
- DISALLOW_COPY(LayerTilingData);
-};
-
-} // namespace cc
-
-#endif // CC_LAYER_TILING_DATA_H_
« no previous file with comments | « cc/layer_quad_unittest.cc ('k') | cc/layer_tiling_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698