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

Unified Diff: src/codec/SkRawAdapterCodec.cpp

Issue 1520403003: Prototype of RAW decoding in Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: * Add DNG scaling. * Adress all comments. Created 4 years, 11 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
Index: src/codec/SkRawAdapterCodec.cpp
diff --git a/src/codec/SkRawAdapterCodec.cpp b/src/codec/SkRawAdapterCodec.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9756651bbe13f5c4b5b747359939a1b788e11ce3
--- /dev/null
+++ b/src/codec/SkRawAdapterCodec.cpp
@@ -0,0 +1,30 @@
+/*
+ * 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 "SkCodec.h"
+#include "SkCodecPriv.h"
+#include "SkRawAdapterCodec.h"
+
+SkRawAdapterCodec::SkRawAdapterCodec(SkRawCodec* codec)
+ : INHERITED(codec)
+{}
+
+SkISize SkRawAdapterCodec::onGetSampledDimensions(int sampleSize) const {
scroggo 2016/01/08 17:12:25 This file is starting to look almost exactly like
yujieqin 2016/01/11 14:03:07 These two do look similar to some extend, but, as
+ float scale = 1.f / static_cast<float>(sampleSize);
+ return this->codec()->getScaledDimensions(scale);
+}
+
+SkCodec::Result SkRawAdapterCodec::onGetAndroidPixels(
+ const SkImageInfo& info, void* pixels, size_t rowBytes,
+ const AndroidOptions& options) {
+ SkCodec::Options codecOptions;
+ codecOptions.fZeroInitialized = options.fZeroInitialized;
+ codecOptions.fSubset = options.fSubset;
+ return this->codec()->getPixels(
+ info, pixels, rowBytes, &codecOptions, options.fColorPtr,
+ options.fColorCount);
+}
« no previous file with comments | « src/codec/SkRawAdapterCodec.h ('k') | src/codec/SkRawCodec.h » ('j') | src/codec/SkRawCodec.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698