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/resources/picture_layer_tiling.h" | 5 #include "cc/resources/picture_layer_tiling.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 state->SetDouble("content_scale", contents_scale_); | 490 state->SetDouble("content_scale", contents_scale_); |
491 state->Set("content_bounds", | 491 state->Set("content_bounds", |
492 MathUtil::AsValue(ContentRect().size()).release()); | 492 MathUtil::AsValue(ContentRect().size()).release()); |
493 return state.PassAs<base::Value>(); | 493 return state.PassAs<base::Value>(); |
494 } | 494 } |
495 | 495 |
496 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { | 496 size_t PictureLayerTiling::GPUMemoryUsageInBytes() const { |
497 size_t amount = 0; | 497 size_t amount = 0; |
498 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { | 498 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { |
499 const Tile* tile = it->second.get(); | 499 const Tile* tile = it->second.get(); |
500 amount += tile->tile_version().GPUMemoryUsageInBytes(); | 500 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
| 501 amount += tile->tile_version( |
| 502 static_cast<TileRasterMode>(mode)).GPUMemoryUsageInBytes(); |
| 503 } |
501 } | 504 } |
502 return amount; | 505 return amount; |
503 } | 506 } |
504 | 507 |
505 namespace { | 508 namespace { |
506 | 509 |
507 // This struct represents an event at which the expending rect intersects | 510 // This struct represents an event at which the expending rect intersects |
508 // one of its boundaries. 4 intersection events will occur during expansion. | 511 // one of its boundaries. 4 intersection events will occur during expansion. |
509 struct EdgeEvent { | 512 struct EdgeEvent { |
510 enum { BOTTOM, TOP, LEFT, RIGHT } edge; | 513 enum { BOTTOM, TOP, LEFT, RIGHT } edge; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 | 624 |
622 // If our delta is less then our event distance, we're done. | 625 // If our delta is less then our event distance, we're done. |
623 if (delta < event.distance) | 626 if (delta < event.distance) |
624 break; | 627 break; |
625 } | 628 } |
626 | 629 |
627 return gfx::Rect(origin_x, origin_y, width, height); | 630 return gfx::Rect(origin_x, origin_y, width, height); |
628 } | 631 } |
629 | 632 |
630 } // namespace cc | 633 } // namespace cc |
OLD | NEW |