Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: ui/android/resources/crushed_sprite_resource.cc

Issue 2406103002: [tracing] Add memory usage of Android UI resources to memory-infra (Closed)
Patch Set: Fixes. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/android/resources/crushed_sprite_resource.h" 5 #include "ui/android/resources/crushed_sprite_resource.h"
6 6
7 #include "cc/resources/scoped_ui_resource.h"
8 #include "cc/trees/layer_tree_host.h" 7 #include "cc/trees/layer_tree_host.h"
9 #include "ui/gfx/android/java_bitmap.h" 8 #include "ui/gfx/android/java_bitmap.h"
10 9
11 namespace ui { 10 namespace ui {
12 11
13 CrushedSpriteResource::CrushedSpriteResource( 12 CrushedSpriteResource::CrushedSpriteResource(
14 const SkBitmap& bitmap, 13 const SkBitmap& bitmap,
15 const SrcDstRects& src_dst_rects, 14 const SrcDstRects& src_dst_rects,
16 gfx::Size unscaled_sprite_size, 15 gfx::Size unscaled_sprite_size,
17 gfx::Size scaled_sprite_size) 16 gfx::Size scaled_sprite_size)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 52 }
54 53
55 gfx::Size CrushedSpriteResource::GetScaledSpriteSize() { 54 gfx::Size CrushedSpriteResource::GetScaledSpriteSize() {
56 return scaled_sprite_size_; 55 return scaled_sprite_size_;
57 } 56 }
58 57
59 int CrushedSpriteResource::GetFrameCount() { 58 int CrushedSpriteResource::GetFrameCount() {
60 return src_dst_rects_.size(); 59 return src_dst_rects_.size();
61 } 60 }
62 61
62 size_t CrushedSpriteResource::GetAllocatedSizeInBytes() const {
63 return bitmap_.getSize();
64 }
65
63 } // namespace ui 66 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698