OLD | NEW |
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 #ifndef SkShader_DEFINED | 8 #ifndef SkShader_DEFINED |
9 #define SkShader_DEFINED | 9 #define SkShader_DEFINED |
10 | 10 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 }; | 309 }; |
310 | 310 |
311 virtual bool asACompose(ComposeRec*) const { return false; } | 311 virtual bool asACompose(ComposeRec*) const { return false; } |
312 | 312 |
313 #if SK_SUPPORT_GPU | 313 #if SK_SUPPORT_GPU |
314 struct AsFPArgs { | 314 struct AsFPArgs { |
315 AsFPArgs(GrContext* context, | 315 AsFPArgs(GrContext* context, |
316 const SkMatrix* viewMatrix, | 316 const SkMatrix* viewMatrix, |
317 const SkMatrix* localMatrix, | 317 const SkMatrix* localMatrix, |
318 SkFilterQuality filterQuality, | 318 SkFilterQuality filterQuality, |
| 319 SkColorSpace* dstColorSpace, |
319 SkSourceGammaTreatment gammaTreatment) | 320 SkSourceGammaTreatment gammaTreatment) |
320 : fContext(context) | 321 : fContext(context) |
321 , fViewMatrix(viewMatrix) | 322 , fViewMatrix(viewMatrix) |
322 , fLocalMatrix(localMatrix) | 323 , fLocalMatrix(localMatrix) |
323 , fFilterQuality(filterQuality) | 324 , fFilterQuality(filterQuality) |
| 325 , fDstColorSpace(dstColorSpace) |
324 , fGammaTreatment(gammaTreatment) {} | 326 , fGammaTreatment(gammaTreatment) {} |
325 | 327 |
326 GrContext* fContext; | 328 GrContext* fContext; |
327 const SkMatrix* fViewMatrix; | 329 const SkMatrix* fViewMatrix; |
328 const SkMatrix* fLocalMatrix; | 330 const SkMatrix* fLocalMatrix; |
329 SkFilterQuality fFilterQuality; | 331 SkFilterQuality fFilterQuality; |
| 332 SkColorSpace* fDstColorSpace; |
330 SkSourceGammaTreatment fGammaTreatment; | 333 SkSourceGammaTreatment fGammaTreatment; |
331 }; | 334 }; |
332 | 335 |
333 /** | 336 /** |
334 * Returns a GrFragmentProcessor that implements the shader for the GPU bac
kend. NULL is | 337 * Returns a GrFragmentProcessor that implements the shader for the GPU bac
kend. NULL is |
335 * returned if there is no GPU implementation. | 338 * returned if there is no GPU implementation. |
336 * | 339 * |
337 * The GPU device does not call SkShader::createContext(), instead we pass
the view matrix, | 340 * The GPU device does not call SkShader::createContext(), instead we pass
the view matrix, |
338 * local matrix, and filter quality directly. | 341 * local matrix, and filter quality directly. |
339 * | 342 * |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 SkMatrix fLocalMatrix; | 518 SkMatrix fLocalMatrix; |
516 | 519 |
517 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. | 520 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. |
518 friend class SkLocalMatrixShader; | 521 friend class SkLocalMatrixShader; |
519 friend class SkBitmapProcShader; // for computeTotalInverse() | 522 friend class SkBitmapProcShader; // for computeTotalInverse() |
520 | 523 |
521 typedef SkFlattenable INHERITED; | 524 typedef SkFlattenable INHERITED; |
522 }; | 525 }; |
523 | 526 |
524 #endif | 527 #endif |
OLD | NEW |