| 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 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 SetNeedsCommit(); | 631 SetNeedsCommit(); |
| 632 } | 632 } |
| 633 | 633 |
| 634 void LayerTreeHost::SetOverhangBitmap(const SkBitmap& bitmap) { | 634 void LayerTreeHost::SetOverhangBitmap(const SkBitmap& bitmap) { |
| 635 DCHECK(bitmap.width() && bitmap.height()); | 635 DCHECK(bitmap.width() && bitmap.height()); |
| 636 DCHECK_EQ(bitmap.bytesPerPixel(), 4); | 636 DCHECK_EQ(bitmap.bytesPerPixel(), 4); |
| 637 | 637 |
| 638 scoped_refptr<UIResourceBitmap> overhang_ui_bitmap(UIResourceBitmap::Create( | 638 scoped_refptr<UIResourceBitmap> overhang_ui_bitmap(UIResourceBitmap::Create( |
| 639 new uint8_t[bitmap.width() * bitmap.height() * bitmap.bytesPerPixel()], | 639 new uint8_t[bitmap.width() * bitmap.height() * bitmap.bytesPerPixel()], |
| 640 UIResourceBitmap::RGBA8, | 640 UIResourceBitmap::RGBA8, |
| 641 UIResourceBitmap::REPEAT, |
| 641 gfx::Size(bitmap.width(), bitmap.height()))); | 642 gfx::Size(bitmap.width(), bitmap.height()))); |
| 642 bitmap.copyPixelsTo( | 643 bitmap.copyPixelsTo( |
| 643 overhang_ui_bitmap->GetPixels(), | 644 overhang_ui_bitmap->GetPixels(), |
| 644 bitmap.width() * bitmap.height() * bitmap.bytesPerPixel(), | 645 bitmap.width() * bitmap.height() * bitmap.bytesPerPixel(), |
| 645 bitmap.width() * bitmap.bytesPerPixel()); | 646 bitmap.width() * bitmap.bytesPerPixel()); |
| 646 overhang_ui_resource_ = ScopedUIResource::Create(this, overhang_ui_bitmap); | 647 overhang_ui_resource_ = ScopedUIResource::Create(this, overhang_ui_bitmap); |
| 647 } | 648 } |
| 648 | 649 |
| 649 void LayerTreeHost::SetVisible(bool visible) { | 650 void LayerTreeHost::SetVisible(bool visible) { |
| 650 if (visible_ == visible) | 651 if (visible_ == visible) |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 void LayerTreeHost::DidLoseUIResources() { | 1191 void LayerTreeHost::DidLoseUIResources() { |
| 1191 // When output surface is lost, we need to recreate the resource. | 1192 // When output surface is lost, we need to recreate the resource. |
| 1192 for (UIResourceClientMap::iterator iter = ui_resource_client_map_.begin(); | 1193 for (UIResourceClientMap::iterator iter = ui_resource_client_map_.begin(); |
| 1193 iter != ui_resource_client_map_.end(); | 1194 iter != ui_resource_client_map_.end(); |
| 1194 ++iter) { | 1195 ++iter) { |
| 1195 UIResourceLost(iter->first); | 1196 UIResourceLost(iter->first); |
| 1196 } | 1197 } |
| 1197 } | 1198 } |
| 1198 | 1199 |
| 1199 } // namespace cc | 1200 } // namespace cc |
| OLD | NEW |