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

Side by Side Diff: src/core/SkImageGenerator.cpp

Issue 1404433002: Remove image usage type enum. Use GrTextureParams instead. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix no gpu build Created 5 years, 2 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/core/SkImageFilter.cpp ('k') | src/core/SkLightingShader.cpp » ('j') | 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 2014 Google Inc. 2 * Copyright 2014 Google Inc.
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 "SkImageGenerator.h" 8 #include "SkImageGenerator.h"
9 #include "SkNextID.h" 9 #include "SkNextID.h"
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // In order to maintain compatibility with clients that implemented the orig inal 97 // In order to maintain compatibility with clients that implemented the orig inal
98 // onGetYUV8Planes interface, we assume that the color space is JPEG. 98 // onGetYUV8Planes interface, we assume that the color space is JPEG.
99 // TODO(rileya): remove this and the old onGetYUV8Planes once clients switch over to 99 // TODO(rileya): remove this and the old onGetYUV8Planes once clients switch over to
100 // the new interface. 100 // the new interface.
101 if (colorSpace) { 101 if (colorSpace) {
102 *colorSpace = kJPEG_SkYUVColorSpace; 102 *colorSpace = kJPEG_SkYUVColorSpace;
103 } 103 }
104 return this->onGetYUV8Planes(sizes, planes, rowBytes); 104 return this->onGetYUV8Planes(sizes, planes, rowBytes);
105 } 105 }
106 106
107 GrTexture* SkImageGenerator::generateTexture(GrContext* ctx, SkImageUsageType us age, 107 GrTexture* SkImageGenerator::generateTexture(GrContext* ctx, const GrTexturePara ms& params,
108 const SkIRect* subset) { 108 const SkIRect* subset) {
109 if (subset && !SkIRect::MakeWH(fInfo.width(), fInfo.height()).contains(*subs et)) { 109 if (subset && !SkIRect::MakeWH(fInfo.width(), fInfo.height()).contains(*subs et)) {
110 return nullptr; 110 return nullptr;
111 } 111 }
112 return this->onGenerateTexture(ctx, usage, subset); 112 return this->onGenerateTexture(ctx, params, subset);
113 } 113 }
114 114
115 //////////////////////////////////////////////////////////////////////////////// ///////////// 115 //////////////////////////////////////////////////////////////////////////////// /////////////
116 116
117 SkData* SkImageGenerator::onRefEncodedData() { 117 SkData* SkImageGenerator::onRefEncodedData() {
118 return nullptr; 118 return nullptr;
119 } 119 }
120 120
121 bool SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst, size_t rb , 121 bool SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst, size_t rb ,
122 SkPMColor* colors, int* colorCount) { 122 SkPMColor* colors, int* colorCount) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 if (nullptr == data) { 215 if (nullptr == data) {
216 return nullptr; 216 return nullptr;
217 } 217 }
218 if (gFactory) { 218 if (gFactory) {
219 if (SkImageGenerator* generator = gFactory(data)) { 219 if (SkImageGenerator* generator = gFactory(data)) {
220 return generator; 220 return generator;
221 } 221 }
222 } 222 }
223 return SkImageGenerator::NewFromEncodedImpl(data); 223 return SkImageGenerator::NewFromEncodedImpl(data);
224 } 224 }
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698