| 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 DCHECK_EQ(bitmap.bytesPerPixel(), 4); | 686 DCHECK_EQ(bitmap.bytesPerPixel(), 4); |
| 687 | 687 |
| 688 SkBitmap bitmap_copy; | 688 SkBitmap bitmap_copy; |
| 689 if (bitmap.isImmutable()) { | 689 if (bitmap.isImmutable()) { |
| 690 bitmap_copy = bitmap; | 690 bitmap_copy = bitmap; |
| 691 } else { | 691 } else { |
| 692 bitmap.copyTo(&bitmap_copy, bitmap.config()); | 692 bitmap.copyTo(&bitmap_copy, bitmap.config()); |
| 693 bitmap_copy.setImmutable(); | 693 bitmap_copy.setImmutable(); |
| 694 } | 694 } |
| 695 | 695 |
| 696 overhang_ui_resource_ = ScopedUIResource::Create( | 696 UIResourceBitmap overhang_bitmap(bitmap_copy); |
| 697 this, UIResourceBitmap(bitmap_copy, UIResourceBitmap::REPEAT)); | 697 overhang_bitmap.SetWrapMode(UIResourceBitmap::REPEAT); |
| 698 overhang_ui_resource_ = ScopedUIResource::Create(this, overhang_bitmap); |
| 698 } | 699 } |
| 699 | 700 |
| 700 void LayerTreeHost::SetVisible(bool visible) { | 701 void LayerTreeHost::SetVisible(bool visible) { |
| 701 if (visible_ == visible) | 702 if (visible_ == visible) |
| 702 return; | 703 return; |
| 703 visible_ = visible; | 704 visible_ = visible; |
| 704 if (!visible) | 705 if (!visible) |
| 705 ReduceMemoryUsage(); | 706 ReduceMemoryUsage(); |
| 706 proxy_->SetVisible(visible); | 707 proxy_->SetVisible(visible); |
| 707 } | 708 } |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 | 1278 |
| 1278 bool LayerTreeHost::ScheduleMicroBenchmark( | 1279 bool LayerTreeHost::ScheduleMicroBenchmark( |
| 1279 const std::string& benchmark_name, | 1280 const std::string& benchmark_name, |
| 1280 scoped_ptr<base::Value> value, | 1281 scoped_ptr<base::Value> value, |
| 1281 const MicroBenchmark::DoneCallback& callback) { | 1282 const MicroBenchmark::DoneCallback& callback) { |
| 1282 return micro_benchmark_controller_.ScheduleRun( | 1283 return micro_benchmark_controller_.ScheduleRun( |
| 1283 benchmark_name, value.Pass(), callback); | 1284 benchmark_name, value.Pass(), callback); |
| 1284 } | 1285 } |
| 1285 | 1286 |
| 1286 } // namespace cc | 1287 } // namespace cc |
| OLD | NEW |