| 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 } | 524 } |
| 525 | 525 |
| 526 return *this; | 526 return *this; |
| 527 } | 527 } |
| 528 | 528 |
| 529 gfx::Rect PictureLayerTiling::CoverageIterator::geometry_rect() const { | 529 gfx::Rect PictureLayerTiling::CoverageIterator::geometry_rect() const { |
| 530 return current_geometry_rect_; | 530 return current_geometry_rect_; |
| 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 auto tex_origin = gfx::PointF( |
| 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::RectF(gfx::SizeF(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 |
| (...skipping 459 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 |