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

Side by Side Diff: src/ports/SkImageGenerator_skia.cpp

Issue 863053002: new API for retrieving YUV data (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dox Created 5 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 unified diff | Download patch
« no previous file with comments | « src/lazy/SkDiscardablePixelRef.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The Android Open Source Project 2 * Copyright 2015 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkData.h" 8 #include "SkData.h"
9 #include "SkImageDecoder.h" 9 #include "SkImageDecoder.h"
10 #include "SkImageGenerator.h" 10 #include "SkImageGenerator.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (NULL == ctable) { 79 if (NULL == ctable) {
80 return false; 80 return false;
81 } 81 }
82 const int count = ctable->count(); 82 const int count = ctable->count();
83 memcpy(ctableEntries, ctable->readColors(), count * sizeof(SkPMColor )); 83 memcpy(ctableEntries, ctable->readColors(), count * sizeof(SkPMColor ));
84 *ctableCount = count; 84 *ctableCount = count;
85 } 85 }
86 return true; 86 return true;
87 } 87 }
88 88
89 bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], 89 bool onQueryYUV8(SkISize logical[3], SkISize optimal[3]) SK_OVERRIDE {
90 SkYUVColorSpace* colorSpace) SK_OVERRIDE {
91 SkMemoryStream stream(fData->data(), fData->size(), false); 90 SkMemoryStream stream(fData->data(), fData->size(), false);
92 return fDecoder->decodeYUV8Planes(&stream, sizes, planes, rowBytes, colo rSpace); 91 return false;//fDecoder->decodeYUV8Planes(&stream, sizes, planes, rowByt es, colorSpace);
93 } 92 }
94 93
94 bool onGetYUV8(const SkISize sizes[3], void* planes[3], SkYUVColorSpace* csp ace) SK_OVERRIDE {
95 SkMemoryStream stream(fData->data(), fData->size(), false);
96 return false;//fDecoder->decodeYUV8Planes(&stream, sizes, planes, rowByt es, colorSpace);
97 }
95 }; 98 };
96 99
97 SkImageGenerator* SkImageGenerator::NewFromData(SkData* data) { 100 SkImageGenerator* SkImageGenerator::NewFromData(SkData* data) {
98 if (NULL == data) { 101 if (NULL == data) {
99 return NULL; 102 return NULL;
100 } 103 }
101 104
102 SkMemoryStream stream(data->data(), data->size(), false); 105 SkMemoryStream stream(data->data(), data->size(), false);
103 SkImageDecoder* decoder = SkImageDecoder::Factory(&stream); 106 SkImageDecoder* decoder = SkImageDecoder::Factory(&stream);
104 if (NULL == decoder) { 107 if (NULL == decoder) {
105 return NULL; 108 return NULL;
106 } 109 }
107 110
108 SkBitmap bm; 111 SkBitmap bm;
109 stream.rewind(); 112 stream.rewind();
110 if (!decoder->decode(&stream, &bm, kUnknown_SkColorType, SkImageDecoder::kDe codeBounds_Mode)) { 113 if (!decoder->decode(&stream, &bm, kUnknown_SkColorType, SkImageDecoder::kDe codeBounds_Mode)) {
111 SkDELETE(decoder); 114 SkDELETE(decoder);
112 return NULL; 115 return NULL;
113 } 116 }
114 117
115 return SkNEW_ARGS(SkImageDecoderGenerator, (bm.info(), decoder, data)); 118 return SkNEW_ARGS(SkImageDecoderGenerator, (bm.info(), decoder, data));
116 } 119 }
OLDNEW
« no previous file with comments | « src/lazy/SkDiscardablePixelRef.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698