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

Side by Side Diff: include/core/SkShader.h

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 | « include/core/SkPicture.h ('k') | samplecode/SampleApp.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 2006 The Android Open Source Project 2 * Copyright 2006 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 8
9 #ifndef SkShader_DEFINED 9 #ifndef SkShader_DEFINED
10 #define SkShader_DEFINED 10 #define SkShader_DEFINED
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 471
472 /** 472 /**
473 * If this shader can be represented by another shader + a localMatrix, ret urn that shader 473 * If this shader can be represented by another shader + a localMatrix, ret urn that shader
474 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo calMatrix parameter. 474 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo calMatrix parameter.
475 * 475 *
476 * Note: the returned shader (if not NULL) will have been ref'd, and it is the responsibility 476 * Note: the returned shader (if not NULL) will have been ref'd, and it is the responsibility
477 * of the caller to balance that with unref() when they are done. 477 * of the caller to balance that with unref() when they are done.
478 */ 478 */
479 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; 479 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const;
480 480
481 void preroll() const { this->onPreroll(); }
482
481 SK_TO_STRING_VIRT() 483 SK_TO_STRING_VIRT()
482 SK_DEFINE_FLATTENABLE_TYPE(SkShader) 484 SK_DEFINE_FLATTENABLE_TYPE(SkShader)
483 485
484 protected: 486 protected:
485 void flatten(SkWriteBuffer&) const SK_OVERRIDE; 487 void flatten(SkWriteBuffer&) const SK_OVERRIDE;
486 488
487 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const; 489 bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const;
488 490
489 /** 491 /**
490 * Your subclass must also override contextSize() if it overrides onCreateC ontext(). 492 * Your subclass must also override contextSize() if it overrides onCreateC ontext().
491 * Base class impl returns NULL. 493 * Base class impl returns NULL.
492 */ 494 */
493 virtual Context* onCreateContext(const ContextRec&, void* storage) const; 495 virtual Context* onCreateContext(const ContextRec&, void* storage) const;
494 496
497 virtual void onPreroll() const {}
495 virtual bool onAsLuminanceColor(SkColor*) const { 498 virtual bool onAsLuminanceColor(SkColor*) const {
496 return false; 499 return false;
497 } 500 }
498 private: 501 private:
499 // This is essentially const, but not officially so it can be modified in 502 // This is essentially const, but not officially so it can be modified in
500 // constructors. 503 // constructors.
501 SkMatrix fLocalMatrix; 504 SkMatrix fLocalMatrix;
502 505
503 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. 506 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor.
504 friend class SkLocalMatrixShader; 507 friend class SkLocalMatrixShader;
505 508
506 typedef SkFlattenable INHERITED; 509 typedef SkFlattenable INHERITED;
507 }; 510 };
508 511
509 #endif 512 #endif
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698