diff options
author | tomhudson@chromium.org <tomhudson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 12:37:43 +0000 |
---|---|---|
committer | tomhudson@chromium.org <tomhudson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 12:37:43 +0000 |
commit | 9716a53df5b6d90cbd699932b555028d7fffc2d6 (patch) | |
tree | 9e545ea6a8ee9ef299bab58b02e7fe10bdee3e92 /cc | |
parent | d60064e10fb9e81844934bc791407802c821ae59 (diff) | |
download | chromium_src-9716a53df5b6d90cbd699932b555028d7fffc2d6.zip chromium_src-9716a53df5b6d90cbd699932b555028d7fffc2d6.tar.gz chromium_src-9716a53df5b6d90cbd699932b555028d7fffc2d6.tar.bz2 |
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
Diffstat (limited to 'cc')
-rw-r--r-- | cc/resources/tile_manager.cc | 3 | ||||
-rw-r--r-- | cc/test/skia_common.cc | 4 | ||||
-rw-r--r-- | cc/test/skia_common.h | 1 |
3 files changed, 6 insertions, 2 deletions
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; |