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

Unified Diff: src/codec/SkAndroidRawCodec.cpp

Issue 1520403003: Prototype of RAW decoding in Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Initial upload of the Prototype. Created 5 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
Index: src/codec/SkAndroidRawCodec.cpp
diff --git a/src/codec/SkAndroidRawCodec.cpp b/src/codec/SkAndroidRawCodec.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..bc627be3ba05b0e335ae052fa4e58c98f8f431e2
--- /dev/null
+++ b/src/codec/SkAndroidRawCodec.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 "SkAndroidRawCodec.h"
+
+SkAndroidRawCodec::SkAndroidRawCodec(SkRawCodec* codec)
+ : INHERITED(codec)
+{}
+
+SkISize SkAndroidRawCodec::onGetSampledDimensions(int sampleSize) const {
+ // No scaling yet available.
+ return this->codec()->getInfo().dimensions();
+}
+
+SkCodec::Result SkAndroidRawCodec::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);
+}

Powered by Google App Engine
This is Rietveld 408576698