OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/tiles/picture_layer_tiling.h" | 5 #include "cc/tiles/picture_layer_tiling.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <set> | 10 #include <set> |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 } | 531 } |
532 | 532 |
533 gfx::RectF PictureLayerTiling::CoverageIterator::texture_rect() const { | 533 gfx::RectF PictureLayerTiling::CoverageIterator::texture_rect() const { |
534 gfx::PointF tex_origin = | 534 gfx::PointF tex_origin = |
535 tiling_->tiling_data_.TileBoundsWithBorder(tile_i_, tile_j_).origin(); | 535 tiling_->tiling_data_.TileBoundsWithBorder(tile_i_, tile_j_).origin(); |
536 | 536 |
537 // Convert from dest space => content space => texture space. | 537 // Convert from dest space => content space => texture space. |
538 gfx::RectF texture_rect(current_geometry_rect_); | 538 gfx::RectF texture_rect(current_geometry_rect_); |
539 texture_rect.Scale(dest_to_content_scale_, | 539 texture_rect.Scale(dest_to_content_scale_, |
540 dest_to_content_scale_); | 540 dest_to_content_scale_); |
541 texture_rect.Intersect(gfx::Rect(tiling_->tiling_size())); | 541 texture_rect.Intersect(gfx::RectF(gfx::SizeF(tiling_->tiling_size()))); |
542 if (texture_rect.IsEmpty()) | 542 if (texture_rect.IsEmpty()) |
543 return texture_rect; | 543 return texture_rect; |
544 texture_rect.Offset(-tex_origin.OffsetFromOrigin()); | 544 texture_rect.Offset(-tex_origin.OffsetFromOrigin()); |
545 | 545 |
546 return texture_rect; | 546 return texture_rect; |
547 } | 547 } |
548 | 548 |
549 ScopedTilePtr PictureLayerTiling::TakeTileAt(int i, int j) { | 549 ScopedTilePtr PictureLayerTiling::TakeTileAt(int i, int j) { |
550 TileMap::iterator found = tiles_.find(TileMapKey(i, j)); | 550 TileMap::iterator found = tiles_.find(TileMapKey(i, j)); |
551 if (found == tiles_.end()) | 551 if (found == tiles_.end()) |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { | 1005 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { |
1006 size_t amount = 0; | 1006 size_t amount = 0; |
1007 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { | 1007 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { |
1008 const Tile* tile = it->second; | 1008 const Tile* tile = it->second; |
1009 amount += tile->GPUMemoryUsageInBytes(); | 1009 amount += tile->GPUMemoryUsageInBytes(); |
1010 } | 1010 } |
1011 return amount; | 1011 return amount; |
1012 } | 1012 } |
1013 | 1013 |
1014 } // namespace cc | 1014 } // namespace cc |
OLD | NEW |