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

Unified Diff: src/utils/SkBitmapRegionDecoderInterface.cpp

Issue 1322773004: Revert of Provides multiple implementations of Android's SkBitmapRegionDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months 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/utils/SkBitmapRegionDecoderInterface.h ('k') | src/utils/SkBitmapRegionSampler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkBitmapRegionDecoderInterface.cpp
diff --git a/src/utils/SkBitmapRegionDecoderInterface.cpp b/src/utils/SkBitmapRegionDecoderInterface.cpp
deleted file mode 100644
index 090f042ce34517c45324704536c4ae0b8ac76be0..0000000000000000000000000000000000000000
--- a/src/utils/SkBitmapRegionDecoderInterface.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkBitmapRegionCanvas.h"
-#include "SkBitmapRegionDecoderInterface.h"
-#include "SkBitmapRegionSampler.h"
-#include "SkScanlineDecoder.h"
-#include "SkImageDecoder.h"
-
-SkBitmapRegionDecoderInterface* SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(
- SkStreamRewindable* stream, Strategy strategy) {
- switch (strategy) {
- case kOriginal_Strategy: {
- SkImageDecoder* decoder = SkImageDecoder::Factory(stream);
- int width, height;
- if (nullptr == decoder) {
- SkDebugf("Error: Could not create image decoder.\n");
- return nullptr;
- }
- if (!decoder->buildTileIndex(stream, &width, &height)) {
- SkDebugf("Error: Could not build tile index.\n");
- delete decoder;
- return nullptr;
- }
- return new SkBitmapRegionSampler(decoder, width, height);
- }
- case kCanvas_Strategy: {
- SkScanlineDecoder* decoder = SkScanlineDecoder::NewFromStream(stream);
- if (nullptr == decoder) {
- SkDebugf("Error: Failed to create decoder.\n");
- return nullptr;
- }
- switch (decoder->getScanlineOrder()) {
- case SkScanlineDecoder::kTopDown_SkScanlineOrder:
- case SkScanlineDecoder::kNone_SkScanlineOrder:
- break;
- default:
- SkDebugf("Error: Scanline ordering not supported.\n");
- return nullptr;
- }
- return new SkBitmapRegionCanvas(decoder);
- }
- default:
- SkASSERT(false);
- return nullptr;
- }
-}
« no previous file with comments | « src/utils/SkBitmapRegionDecoderInterface.h ('k') | src/utils/SkBitmapRegionSampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698