| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layers/tiled_layer.h" | 5 #include "cc/layers/tiled_layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 // texture updater to be deleted. However, we can't free the memory backing | 476 // texture updater to be deleted. However, we can't free the memory backing |
| 477 // the SkCanvas until the paint finishes, so we grab a local reference here to | 477 // the SkCanvas until the paint finishes, so we grab a local reference here to |
| 478 // hold the updater alive until the paint completes. | 478 // hold the updater alive until the paint completes. |
| 479 scoped_refptr<LayerUpdater> protector(Updater()); | 479 scoped_refptr<LayerUpdater> protector(Updater()); |
| 480 gfx::Rect painted_opaque_rect; | 480 gfx::Rect painted_opaque_rect; |
| 481 Updater()->PrepareToUpdate(paint_rect, | 481 Updater()->PrepareToUpdate(paint_rect, |
| 482 tiler_->tile_size(), | 482 tiler_->tile_size(), |
| 483 1.f / width_scale, | 483 1.f / width_scale, |
| 484 1.f / height_scale, | 484 1.f / height_scale, |
| 485 &painted_opaque_rect); | 485 &painted_opaque_rect); |
| 486 DLOG(INFO) << painted_opaque_rect.ToString(); |
| 486 | 487 |
| 487 for (int j = top; j <= bottom; ++j) { | 488 for (int j = top; j <= bottom; ++j) { |
| 488 for (int i = left; i <= right; ++i) { | 489 for (int i = left; i <= right; ++i) { |
| 489 UpdatableTile* tile = TileAt(i, j); | 490 UpdatableTile* tile = TileAt(i, j); |
| 490 DCHECK(tile); // Did SetTexturePriorites get skipped? | 491 DCHECK(tile); // Did SetTexturePriorites get skipped? |
| 491 // TODO(enne): This should not ever be null. | 492 // TODO(enne): This should not ever be null. |
| 492 if (!tile) | 493 if (!tile) |
| 493 continue; | 494 continue; |
| 494 | 495 |
| 495 gfx::Rect tile_rect = tiler_->tile_bounds(i, j); | 496 gfx::Rect tile_rect = tiler_->tile_bounds(i, j); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 gfx::Rect prepaint_rect = visible_content_rect(); | 893 gfx::Rect prepaint_rect = visible_content_rect(); |
| 893 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 894 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
| 894 -tiler_->tile_size().height() * kPrepaintRows); | 895 -tiler_->tile_size().height() * kPrepaintRows); |
| 895 gfx::Rect content_rect(content_bounds()); | 896 gfx::Rect content_rect(content_bounds()); |
| 896 prepaint_rect.Intersect(content_rect); | 897 prepaint_rect.Intersect(content_rect); |
| 897 | 898 |
| 898 return prepaint_rect; | 899 return prepaint_rect; |
| 899 } | 900 } |
| 900 | 901 |
| 901 } // namespace cc | 902 } // namespace cc |
| OLD | NEW |