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

Unified Diff: ui/android/resources/crushed_sprite_resource.cc

Issue 2798123002: Remove crushed sprite resource and layer (Closed)
Patch Set: Rebase and fix my nits Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/android/resources/crushed_sprite_resource.h ('k') | ui/android/resources/resource_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/android/resources/crushed_sprite_resource.cc
diff --git a/ui/android/resources/crushed_sprite_resource.cc b/ui/android/resources/crushed_sprite_resource.cc
deleted file mode 100644
index f28854968d2350cfd69b9c85bd73d713637c28f0..0000000000000000000000000000000000000000
--- a/ui/android/resources/crushed_sprite_resource.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/android/resources/crushed_sprite_resource.h"
-
-#include "cc/trees/layer_tree_host.h"
-#include "ui/gfx/android/java_bitmap.h"
-
-namespace ui {
-
-CrushedSpriteResource::CrushedSpriteResource(
- const SkBitmap& bitmap,
- const SrcDstRects& src_dst_rects,
- gfx::Size unscaled_sprite_size,
- gfx::Size scaled_sprite_size)
- : src_dst_rects_(src_dst_rects),
- unscaled_sprite_size_(unscaled_sprite_size),
- scaled_sprite_size_(scaled_sprite_size) {
- SetBitmap(bitmap);
-}
-
-CrushedSpriteResource::~CrushedSpriteResource() {
-}
-
-void CrushedSpriteResource::SetBitmap(const SkBitmap& bitmap) {
- bitmap_ = bitmap;
- bitmap_.setImmutable();
-}
-
-const SkBitmap& CrushedSpriteResource::GetBitmap() {
- DCHECK(!bitmap_.empty());
- return bitmap_;
-}
-
-void CrushedSpriteResource::EvictBitmapFromMemory() {
- bitmap_.reset();
-}
-
-bool CrushedSpriteResource::BitmapHasBeenEvictedFromMemory() {
- return bitmap_.empty();
-}
-
-CrushedSpriteResource::FrameSrcDstRects
-CrushedSpriteResource::GetRectanglesForFrame(int frame) {
- DCHECK(frame >= 0 && frame < static_cast<int>(src_dst_rects_.size()));
- return src_dst_rects_[frame];
-}
-
-gfx::Size CrushedSpriteResource::GetUnscaledSpriteSize() {
- return unscaled_sprite_size_;
-}
-
-gfx::Size CrushedSpriteResource::GetScaledSpriteSize() {
- return scaled_sprite_size_;
-}
-
-int CrushedSpriteResource::GetFrameCount() {
- return src_dst_rects_.size();
-}
-
-size_t CrushedSpriteResource::EstimateMemoryUsage() const {
- return bitmap_.getSize();
-}
-
-} // namespace ui
« no previous file with comments | « ui/android/resources/crushed_sprite_resource.h ('k') | ui/android/resources/resource_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698