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

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

Issue 927443006: remove unneeded preroll (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 SkShader::Context* SkPictureShader::onCreateContext(const ContextRec& rec, void* storage) const { 218 SkShader::Context* SkPictureShader::onCreateContext(const ContextRec& rec, void* storage) const {
219 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(*rec.fMatrix, rec. fLocalMatrix)); 219 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(*rec.fMatrix, rec. fLocalMatrix));
220 if (NULL == bitmapShader.get()) { 220 if (NULL == bitmapShader.get()) {
221 return NULL; 221 return NULL;
222 } 222 }
223 return PictureShaderContext::Create(storage, *this, rec, bitmapShader); 223 return PictureShaderContext::Create(storage, *this, rec, bitmapShader);
224 } 224 }
225 225
226 void SkPictureShader::onPreroll() const {
227 fPicture->preroll(NULL, NULL, NULL, NULL);
228 }
229
230 //////////////////////////////////////////////////////////////////////////////// ///////// 226 //////////////////////////////////////////////////////////////////////////////// /////////
231 227
232 SkShader::Context* SkPictureShader::PictureShaderContext::Create(void* storage, 228 SkShader::Context* SkPictureShader::PictureShaderContext::Create(void* storage,
233 const SkPictureShader& shader, const ContextRec& rec, SkShade r* bitmapShader) { 229 const SkPictureShader& shader, const ContextRec& rec, SkShade r* bitmapShader) {
234 PictureShaderContext* ctx = SkNEW_PLACEMENT_ARGS(storage, PictureShaderConte xt, 230 PictureShaderContext* ctx = SkNEW_PLACEMENT_ARGS(storage, PictureShaderConte xt,
235 (shader, rec, bitmapShader) ); 231 (shader, rec, bitmapShader) );
236 if (NULL == ctx->fBitmapShaderContext) { 232 if (NULL == ctx->fBitmapShaderContext) {
237 ctx->~PictureShaderContext(); 233 ctx->~PictureShaderContext();
238 ctx = NULL; 234 ctx = NULL;
239 } 235 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC olor, fp); 303 return bitmapShader->asFragmentProcessor(context, paint, viewM, NULL, paintC olor, fp);
308 } 304 }
309 #else 305 #else
310 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa trix&, 306 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa trix&,
311 const SkMatrix*, GrColor*, 307 const SkMatrix*, GrColor*,
312 GrFragmentProcessor**) const { 308 GrFragmentProcessor**) const {
313 SkDEBUGFAIL("Should not call in GPU-less build"); 309 SkDEBUGFAIL("Should not call in GPU-less build");
314 return false; 310 return false;
315 } 311 }
316 #endif 312 #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