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

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

Issue 808703006: remove view matrix from context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanups Created 6 years 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 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 * the color the effect expects as its input color. If the SkShader wishes to emit a solid 378 * the color the effect expects as its input color. If the SkShader wishes to emit a solid
379 * color then it should set paintColor to that color and not create an effe ct. Note that 379 * color then it should set paintColor to that color and not create an effe ct. Note that
380 * GrColor is always premul. The common patterns are to convert paint's SkC olor to GrColor or 380 * GrColor is always premul. The common patterns are to convert paint's SkC olor to GrColor or
381 * to extract paint's alpha and replicate it to all channels in paintColor. Upon failure 381 * to extract paint's alpha and replicate it to all channels in paintColor. Upon failure
382 * paintColor should not be modified. It is not recommended to specialize t he effect to 382 * paintColor should not be modified. It is not recommended to specialize t he effect to
383 * the paint's color as then many GPU shaders may be generated. 383 * the paint's color as then many GPU shaders may be generated.
384 * 384 *
385 * The GrContext may be used by the effect to create textures. The GPU devi ce does not 385 * The GrContext may be used by the effect to create textures. The GPU devi ce does not
386 * call createContext. Instead we pass the SkPaint here in case the shader needs paint info. 386 * call createContext. Instead we pass the SkPaint here in case the shader needs paint info.
387 */ 387 */
388 virtual bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix* , GrColor*, 388 virtual bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix& viewM,
bsalomon 2014/12/17 17:12:33 Need to update comments to reflect these changes.
joshualitt 2014/12/17 19:19:58 :( I actually have no idea what the second matrix
389 GrFragmentProcessor**) const; 389 const SkMatrix*, GrColor*, GrFragmentProces sor**) const;
390 390
391 /** 391 /**
392 * If the shader can represent its "average" luminance in a single color, r eturn true and 392 * If the shader can represent its "average" luminance in a single color, r eturn true and
393 * if color is not NULL, return that color. If it cannot, return false and ignore the color 393 * if color is not NULL, return that color. If it cannot, return false and ignore the color
394 * parameter. 394 * parameter.
395 * 395 *
396 * Note: if this returns true, the returned color will always be opaque, as only the RGB 396 * Note: if this returns true, the returned color will always be opaque, as only the RGB
397 * components are used to compute luminance. 397 * components are used to compute luminance.
398 */ 398 */
399 bool asLuminanceColor(SkColor*) const; 399 bool asLuminanceColor(SkColor*) const;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 // constructors. 496 // constructors.
497 SkMatrix fLocalMatrix; 497 SkMatrix fLocalMatrix;
498 498
499 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. 499 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor.
500 friend class SkLocalMatrixShader; 500 friend class SkLocalMatrixShader;
501 501
502 typedef SkFlattenable INHERITED; 502 typedef SkFlattenable INHERITED;
503 }; 503 };
504 504
505 #endif 505 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698