From 9716a53df5b6d90cbd699932b555028d7fffc2d6 Mon Sep 17 00:00:00 2001 From: "tomhudson@chromium.org" Date: Fri, 14 Jun 2013 12:37:43 +0000 Subject: Turn on lightweight image decode check. Depends on https://crrev.com/16432002. Activates cheaper test of whether or not an image is decoded, for a savings of 50-70% of CPU time and near-complete elimination of lock contention in ManageTiles() when loading the cnn.com homepage on an Android device. BUG=239632 R=bsalomon,reveman Review URL: https://chromiumcodereview.appspot.com/16332004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206401 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/resources/tile_manager.cc | 3 +-- cc/test/skia_common.cc | 4 ++++ cc/test/skia_common.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'cc') diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 9d499e9..3ebfbe8 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -680,8 +680,7 @@ RasterWorkerPool::RasterTask TileManager::CreateRasterTask( if (decoded_images->find(id) != decoded_images->end()) continue; - // TODO(qinmin): passing correct image size to PrepareToDecode(). - if (pixel_ref->PrepareToDecode(skia::LazyPixelRef::PrepareParams())) { + if (pixel_ref->MaybeDecoded()) { decoded_images->insert(id); rendering_stats_instrumentation_->IncrementDeferredImageCacheHitCount(); continue; diff --git a/cc/test/skia_common.cc b/cc/test/skia_common.cc index c81ae8d..5c83f13 100644 --- a/cc/test/skia_common.cc +++ b/cc/test/skia_common.cc @@ -46,6 +46,10 @@ bool TestLazyPixelRef::PrepareToDecode(const PrepareParams& params) { return true; } +bool TestLazyPixelRef::MaybeDecoded() { + return true; +} + SkPixelRef* TestLazyPixelRef::deepCopy( SkBitmap::Config config, const SkIRect* subset) { diff --git a/cc/test/skia_common.h b/cc/test/skia_common.h index 4d82b76..0b2f84e 100644 --- a/cc/test/skia_common.h +++ b/cc/test/skia_common.h @@ -43,6 +43,7 @@ class TestLazyPixelRef : public skia::LazyPixelRef { virtual void* onLockPixels(SkColorTable** color_table) OVERRIDE; virtual void onUnlockPixels() OVERRIDE {} virtual bool PrepareToDecode(const PrepareParams& params) OVERRIDE; + virtual bool MaybeDecoded() OVERRIDE; virtual SkPixelRef* deepCopy( SkBitmap::Config config, const SkIRect* subset) OVERRIDE; -- cgit v1.1