Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 gfx::ScaleSize(layer_bounds, contents_scale)).IsEmpty()) << | 49 gfx::ScaleSize(layer_bounds, contents_scale)).IsEmpty()) << |
| 50 "Tiling created with scale too small as contents become empty." << | 50 "Tiling created with scale too small as contents become empty." << |
| 51 " Layer bounds: " << layer_bounds.ToString() << | 51 " Layer bounds: " << layer_bounds.ToString() << |
| 52 " Contents scale: " << contents_scale; | 52 " Contents scale: " << contents_scale; |
| 53 | 53 |
| 54 tiling_data_.SetTotalSize(content_bounds); | 54 tiling_data_.SetTotalSize(content_bounds); |
| 55 tiling_data_.SetMaxTextureSize(tile_size); | 55 tiling_data_.SetMaxTextureSize(tile_size); |
| 56 } | 56 } |
| 57 | 57 |
| 58 PictureLayerTiling::~PictureLayerTiling() { | 58 PictureLayerTiling::~PictureLayerTiling() { |
| 59 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { | |
| 60 it->second->SetPriority(ACTIVE_TREE, TilePriority()); | |
|
enne (OOO)
2013/06/26 15:39:27
This tiling is only on one tree, so you shouldn't
| |
| 61 it->second->SetPriority(PENDING_TREE, TilePriority()); | |
| 62 } | |
| 59 } | 63 } |
| 60 | 64 |
| 61 void PictureLayerTiling::SetClient(PictureLayerTilingClient* client) { | 65 void PictureLayerTiling::SetClient(PictureLayerTilingClient* client) { |
| 62 client_ = client; | 66 client_ = client; |
| 63 } | 67 } |
| 64 | 68 |
| 65 gfx::Rect PictureLayerTiling::ContentRect() const { | 69 gfx::Rect PictureLayerTiling::ContentRect() const { |
| 66 return gfx::Rect(tiling_data_.total_size()); | 70 return gfx::Rect(tiling_data_.total_size()); |
| 67 } | 71 } |
| 68 | 72 |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 | 631 |
| 628 // If our delta is less then our event distance, we're done. | 632 // If our delta is less then our event distance, we're done. |
| 629 if (delta < event.distance) | 633 if (delta < event.distance) |
| 630 break; | 634 break; |
| 631 } | 635 } |
| 632 | 636 |
| 633 return gfx::Rect(origin_x, origin_y, width, height); | 637 return gfx::Rect(origin_x, origin_y, width, height); |
| 634 } | 638 } |
| 635 | 639 |
| 636 } // namespace cc | 640 } // namespace cc |
| OLD | NEW |