OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/scoped_ui_resource.h" | 5 #include "cc/resources/scoped_ui_resource.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "cc/trees/layer_tree_host.h" | 9 #include "cc/trees/layer_tree_host.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // User must make sure that host is still valid before this object goes out of | 26 // User must make sure that host is still valid before this object goes out of |
27 // scope. | 27 // scope. |
28 ScopedUIResource::~ScopedUIResource() { | 28 ScopedUIResource::~ScopedUIResource() { |
29 if (id_) { | 29 if (id_) { |
30 DCHECK(host_); | 30 DCHECK(host_); |
31 host_->DeleteUIResource(id_); | 31 host_->DeleteUIResource(id_); |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
| 35 gfx::Size ScopedUIResource::GetSize() const { |
| 36 return bitmap_->GetSize(); |
| 37 } |
| 38 |
35 scoped_refptr<UIResourceBitmap> ScopedUIResource::GetBitmap( | 39 scoped_refptr<UIResourceBitmap> ScopedUIResource::GetBitmap( |
36 UIResourceId uid, | 40 UIResourceId uid, |
37 bool resource_lost) { | 41 bool resource_lost) { |
38 return bitmap_; | 42 return bitmap_; |
39 } | 43 } |
40 | 44 |
41 ScopedUIResource::ScopedUIResource() {} | 45 ScopedUIResource::ScopedUIResource() {} |
42 | 46 |
43 } // namespace cc | 47 } // namespace cc |
OLD | NEW |