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

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

Issue 2434323002: Add isEncoded to SkImageGenerator (Closed)
Patch Set: Created 4 years, 1 month 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
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 const SkIRect subset = SkIRect::MakeXYWH(subsetOrigin.x(), subsetOrigin.y(), 102 const SkIRect subset = SkIRect::MakeXYWH(subsetOrigin.x(), subsetOrigin.y(),
103 subsetPixels.width(), subsetPixels. height()); 103 subsetPixels.width(), subsetPixels. height());
104 if (!SkIRect::MakeWH(scaledSize.width(), scaledSize.height()).contains(subse t)) { 104 if (!SkIRect::MakeWH(scaledSize.width(), scaledSize.height()).contains(subse t)) {
105 return false; 105 return false;
106 } 106 }
107 return this->onGenerateScaledPixels(scaledSize, subsetOrigin, subsetPixels); 107 return this->onGenerateScaledPixels(scaledSize, subsetOrigin, subsetPixels);
108 } 108 }
109 109
110 //////////////////////////////////////////////////////////////////////////////// ///////////// 110 //////////////////////////////////////////////////////////////////////////////// /////////////
111 111
112 bool SkImageGenerator::onIsEncoded() const {
113 return false;
114 }
115
112 SkData* SkImageGenerator::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) { 116 SkData* SkImageGenerator::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) {
113 return nullptr; 117 return nullptr;
114 } 118 }
115 119
116 bool SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst, size_t rb , 120 bool SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst, size_t rb ,
117 SkPMColor* colors, int* colorCount) { 121 SkPMColor* colors, int* colorCount) {
118 return false; 122 return false;
119 } 123 }
120 124
121 //////////////////////////////////////////////////////////////////////////////// /////////////////// 125 //////////////////////////////////////////////////////////////////////////////// ///////////////////
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (nullptr == data) { 214 if (nullptr == data) {
211 return nullptr; 215 return nullptr;
212 } 216 }
213 if (gFactory) { 217 if (gFactory) {
214 if (SkImageGenerator* generator = gFactory(data)) { 218 if (SkImageGenerator* generator = gFactory(data)) {
215 return generator; 219 return generator;
216 } 220 }
217 } 221 }
218 return SkImageGenerator::NewFromEncodedImpl(data); 222 return SkImageGenerator::NewFromEncodedImpl(data);
219 } 223 }
OLDNEW
« include/core/SkImageGenerator.h ('K') | « include/core/SkImageGenerator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698