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

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

Issue 855473002: initial preroll api (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/core/SkPictureShader.h ('k') | src/image/SkImage.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 "SkPictureShader.h" 8 #include "SkPictureShader.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 215
216 SkShader::Context* SkPictureShader::onCreateContext(const ContextRec& rec, void* storage) const { 216 SkShader::Context* SkPictureShader::onCreateContext(const ContextRec& rec, void* storage) const {
217 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(*rec.fMatrix, rec. fLocalMatrix)); 217 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(*rec.fMatrix, rec. fLocalMatrix));
218 if (NULL == bitmapShader.get()) { 218 if (NULL == bitmapShader.get()) {
219 return NULL; 219 return NULL;
220 } 220 }
221 return PictureShaderContext::Create(storage, *this, rec, bitmapShader); 221 return PictureShaderContext::Create(storage, *this, rec, bitmapShader);
222 } 222 }
223 223
224 void SkPictureShader::onPreroll() const {
225 fPicture->preroll(NULL, NULL, NULL, NULL);
226 }
227
224 //////////////////////////////////////////////////////////////////////////////// ///////// 228 //////////////////////////////////////////////////////////////////////////////// /////////
225 229
226 SkShader::Context* SkPictureShader::PictureShaderContext::Create(void* storage, 230 SkShader::Context* SkPictureShader::PictureShaderContext::Create(void* storage,
227 const SkPictureShader& shader, const ContextRec& rec, SkShade r* bitmapShader) { 231 const SkPictureShader& shader, const ContextRec& rec, SkShade r* bitmapShader) {
228 PictureShaderContext* ctx = SkNEW_PLACEMENT_ARGS(storage, PictureShaderConte xt, 232 PictureShaderContext* ctx = SkNEW_PLACEMENT_ARGS(storage, PictureShaderConte xt,
229 (shader, rec, bitmapShader) ); 233 (shader, rec, bitmapShader) );
230 if (NULL == ctx->fBitmapShaderContext) { 234 if (NULL == ctx->fBitmapShaderContext) {
231 ctx->~PictureShaderContext(); 235 ctx->~PictureShaderContext();
232 ctx = NULL; 236 ctx = NULL;
233 } 237 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC olor, fp); 305 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC olor, fp);
302 } 306 }
303 #else 307 #else
304 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa trix&, 308 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa trix&,
305 const SkMatrix*, GrColor*, 309 const SkMatrix*, GrColor*,
306 GrFragmentProcessor**) const { 310 GrFragmentProcessor**) const {
307 SkDEBUGFAIL("Should not call in GPU-less build"); 311 SkDEBUGFAIL("Should not call in GPU-less build");
308 return false; 312 return false;
309 } 313 }
310 #endif 314 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureShader.h ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698