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

Unified Diff: src/lazy/SkLazyCachingPixelRef.cpp

Issue 84083002: SkCachingPixelRef to use SkImageGenerator (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: final rebase Created 7 years 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 | « src/lazy/SkLazyCachingPixelRef.h ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lazy/SkLazyCachingPixelRef.cpp
diff --git a/src/lazy/SkLazyCachingPixelRef.cpp b/src/lazy/SkLazyCachingPixelRef.cpp
deleted file mode 100644
index 730b5f7d27db8874becd65a01680292a5cdc5576..0000000000000000000000000000000000000000
--- a/src/lazy/SkLazyCachingPixelRef.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "Sk64.h"
-#include "SkColorTable.h"
-#include "SkData.h"
-#include "SkImageDecoder.h"
-#include "SkImagePriv.h"
-#include "SkLazyCachingPixelRef.h"
-#include "SkPostConfig.h"
-
-SkLazyCachingPixelRef::SkLazyCachingPixelRef(SkData* data,
- SkBitmapFactory::DecodeProc proc)
- : fDecodeProc(proc) {
- if (NULL == data) {
- fData = SkData::NewEmpty();
- } else {
- fData = data;
- fData->ref();
- }
- if (NULL == fDecodeProc) { // use a reasonable default.
- fDecodeProc = SkImageDecoder::DecodeMemoryToTarget;
- }
- this->setImmutable();
-}
-
-SkLazyCachingPixelRef::~SkLazyCachingPixelRef() {
- SkASSERT(fData != NULL);
- fData->unref();
-}
-
-bool SkLazyCachingPixelRef::onDecodeInfo(SkImageInfo* info) {
- SkASSERT(info);
- return fDecodeProc(fData->data(), fData->size(), info, NULL);
-}
-
-bool SkLazyCachingPixelRef::onDecodePixels(const SkImageInfo& passedInfo,
- void* pixels, size_t rowBytes) {
- SkASSERT(pixels);
- SkImageInfo info;
- if (!this->getInfo(&info)) {
- return false;
- }
- if (passedInfo != info) {
- return false; // This implementation can not handle this case.
- }
- SkBitmapFactory::Target target = {pixels, rowBytes};
- return fDecodeProc(fData->data(), fData->size(), &info, &target);
-}
-
-bool SkLazyCachingPixelRef::Install(SkBitmapFactory::DecodeProc proc,
- SkData* data,
- SkBitmap* destination) {
- SkAutoTUnref<SkLazyCachingPixelRef> ref(
- SkNEW_ARGS(SkLazyCachingPixelRef, (data, proc)));
- return ref->configure(destination) && destination->setPixelRef(ref);
-}
« no previous file with comments | « src/lazy/SkLazyCachingPixelRef.h ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698