SkBitmapProvider.cpp 529 B

123456789101112131415161718192021
  1. /*
  2. * Copyright 2015 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #include "src/core/SkBitmapProvider.h"
  8. #include "src/image/SkImage_Base.h"
  9. SkBitmapCacheDesc SkBitmapProvider::makeCacheDesc() const {
  10. return SkBitmapCacheDesc::Make(fImage);
  11. }
  12. void SkBitmapProvider::notifyAddedToCache() const {
  13. as_IB(fImage)->notifyAddedToRasterCache();
  14. }
  15. bool SkBitmapProvider::asBitmap(SkBitmap* bm) const {
  16. return as_IB(fImage)->getROPixels(bm);
  17. }