| 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/tile.h" | 5 #include "cc/resources/tile.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/debug/trace_event_argument.h" | 9 #include "base/debug/trace_event_argument.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| 11 #include "cc/debug/traced_value.h" | 11 #include "cc/debug/traced_value.h" |
| 12 #include "cc/resources/tile_manager.h" | 12 #include "cc/resources/tile_manager.h" |
| 13 #include "third_party/khronos/GLES2/gl2.h" | 13 #include "third_party/khronos/GLES2/gl2.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 Tile::Id Tile::s_next_id_ = 0; | 17 Tile::Id Tile::s_next_id_ = 0; |
| 18 | 18 |
| 19 Tile::Tile(TileManager* tile_manager, | 19 Tile::Tile(TileManager* tile_manager, |
| 20 PicturePileImpl* picture_pile, | 20 PicturePileImpl* picture_pile, |
| 21 const gfx::Size& tile_size, | 21 const gfx::Size& tile_size, |
| 22 const gfx::Rect& content_rect, | 22 const gfx::Rect& content_rect, |
| 23 const gfx::Rect& opaque_rect, | 23 const gfx::Rect& opaque_rect, |
| 24 float contents_scale, | 24 float contents_scale, |
| 25 int layer_id, | 25 int layer_id, |
| 26 int source_frame_number, | 26 int source_frame_number, |
| 27 int flags) | 27 int flags) |
| 28 : RefCountedManaged<Tile>(tile_manager), | 28 : RefCountedManaged<Tile>(tile_manager), |
| 29 tile_manager_(tile_manager), | 29 tile_manager_(tile_manager), |
| 30 tile_size_(tile_size), | 30 size_(tile_size), |
| 31 content_rect_(content_rect), | 31 content_rect_(content_rect), |
| 32 contents_scale_(contents_scale), | 32 contents_scale_(contents_scale), |
| 33 opaque_rect_(opaque_rect), | 33 opaque_rect_(opaque_rect), |
| 34 layer_id_(layer_id), | 34 layer_id_(layer_id), |
| 35 source_frame_number_(source_frame_number), | 35 source_frame_number_(source_frame_number), |
| 36 flags_(flags), | 36 flags_(flags), |
| 37 id_(s_next_id_++) { | 37 id_(s_next_id_++) { |
| 38 set_picture_pile(picture_pile); | 38 set_picture_pile(picture_pile); |
| 39 for (int i = 0; i < NUM_TREES; i++) | 39 for (int i = 0; i < NUM_TREES; i++) |
| 40 is_occluded_[i] = false; | 40 is_occluded_[i] = false; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 bool Tile::HasRasterTask() const { | 118 bool Tile::HasRasterTask() const { |
| 119 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 119 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
| 120 if (managed_state_.tile_versions[mode].raster_task_) | 120 if (managed_state_.tile_versions[mode].raster_task_) |
| 121 return true; | 121 return true; |
| 122 } | 122 } |
| 123 return false; | 123 return false; |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace cc | 126 } // namespace cc |
| OLD | NEW |