diff options
author | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-13 23:10:25 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-13 23:10:25 +0000 |
commit | 8f7c18685dd79743fc8aa8098b7ddf139730d7cc (patch) | |
tree | be7d4baa9b6bff50ac086cd8b4764468c7969608 /skia | |
parent | eefe2b190e897c9a038a9fb9025a2469047cc65f (diff) | |
download | chromium_src-8f7c18685dd79743fc8aa8098b7ddf139730d7cc.zip chromium_src-8f7c18685dd79743fc8aa8098b7ddf139730d7cc.tar.gz chromium_src-8f7c18685dd79743fc8aa8098b7ddf139730d7cc.tar.bz2 |
implement onNewLockPixels for SkPixelRef
BUG=
Review URL: https://codereview.chromium.org/134683002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/pixel_ref_utils_unittest.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/skia/ext/pixel_ref_utils_unittest.cc b/skia/ext/pixel_ref_utils_unittest.cc index 43801b1..8a6b53f 100644 --- a/skia/ext/pixel_ref_utils_unittest.cc +++ b/skia/ext/pixel_ref_utils_unittest.cc @@ -30,7 +30,10 @@ class TestPixelRef : public SkPixelRef { virtual ~TestPixelRef(); virtual SkFlattenable::Factory getFactory() const OVERRIDE; +#ifdef SK_SUPPORT_LEGACY_ONLOCKPIXELS virtual void* onLockPixels(SkColorTable** color_table) OVERRIDE; +#endif + virtual bool onNewLockPixels(LockRec* rec) OVERRIDE; virtual void onUnlockPixels() OVERRIDE {} virtual SkPixelRef* deepCopy(SkBitmap::Config config, const SkIRect* subset) OVERRIDE; @@ -81,9 +84,21 @@ TestPixelRef::~TestPixelRef() {} SkFlattenable::Factory TestPixelRef::getFactory() const { return NULL; } +#ifdef SK_SUPPORT_LEGACY_ONLOCKPIXELS void* TestPixelRef::onLockPixels(SkColorTable** color_table) { return pixels_.get(); } +#endif + +bool TestPixelRef::onNewLockPixels(LockRec* rec) { + if (pixels_.get()) { + rec->fPixels = pixels_.get(); + rec->fColorTable = NULL; + rec->fRowBytes = 4 * info().fWidth; + return true; + } + return false; +} SkPixelRef* TestPixelRef::deepCopy(SkBitmap::Config config, const SkIRect* subset) { |