| OLD | NEW |
| 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 #ifndef GrXferProcessor_DEFINED | 8 #ifndef GrXferProcessor_DEFINED |
| 9 #define GrXferProcessor_DEFINED | 9 #define GrXferProcessor_DEFINED |
| 10 | 10 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 if (this->fDstTextureOffset != that.fDstTextureOffset) { | 232 if (this->fDstTextureOffset != that.fDstTextureOffset) { |
| 233 return false; | 233 return false; |
| 234 } | 234 } |
| 235 if (this->fDstReadUsesMixedSamples != that.fDstReadUsesMixedSamples) { | 235 if (this->fDstReadUsesMixedSamples != that.fDstReadUsesMixedSamples) { |
| 236 return false; | 236 return false; |
| 237 } | 237 } |
| 238 return this->onIsEqual(that); | 238 return this->onIsEqual(that); |
| 239 } | 239 } |
| 240 | 240 |
| 241 protected: | 241 protected: |
| 242 GrXferProcessor(); | 242 GrXferProcessor(GrRenderTarget* dst); |
| 243 GrXferProcessor(const DstTexture*, bool willReadDstColor, bool hasMixedSampl
es); | 243 GrXferProcessor(const DstTexture*, bool willReadDstColor, bool hasMixedSampl
es, GrRenderTarget* dst); |
| 244 | 244 |
| 245 private: | 245 private: |
| 246 void notifyRefCntIsZero() const final {} | 246 void notifyRefCntIsZero() const final {} |
| 247 | 247 |
| 248 virtual OptFlags onGetOptimizations(const GrProcOptInfo& colorPOI, | 248 virtual OptFlags onGetOptimizations(const GrProcOptInfo& colorPOI, |
| 249 const GrProcOptInfo& coveragePOI, | 249 const GrProcOptInfo& coveragePOI, |
| 250 bool doesStencilWrite, | 250 bool doesStencilWrite, |
| 251 GrColor* overrideColor, | 251 GrColor* overrideColor, |
| 252 const GrCaps& caps) = 0; | 252 const GrCaps& caps) = 0; |
| 253 | 253 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 * creates will have. For example, can it create an XP that supports RGB coverag
e or will the XP | 307 * creates will have. For example, can it create an XP that supports RGB coverag
e or will the XP |
| 308 * blend with the destination color. | 308 * blend with the destination color. |
| 309 */ | 309 */ |
| 310 class GrXPFactory : public SkRefCnt { | 310 class GrXPFactory : public SkRefCnt { |
| 311 public: | 311 public: |
| 312 typedef GrXferProcessor::DstTexture DstTexture; | 312 typedef GrXferProcessor::DstTexture DstTexture; |
| 313 GrXferProcessor* createXferProcessor(const GrProcOptInfo& colorPOI, | 313 GrXferProcessor* createXferProcessor(const GrProcOptInfo& colorPOI, |
| 314 const GrProcOptInfo& coveragePOI, | 314 const GrProcOptInfo& coveragePOI, |
| 315 bool hasMixedSamples, | 315 bool hasMixedSamples, |
| 316 const DstTexture*, | 316 const DstTexture*, |
| 317 const GrCaps& caps) const; | 317 const GrCaps& caps, GrRenderTarget* dst
) const; |
| 318 | 318 |
| 319 /** | 319 /** |
| 320 * This function returns true if the GrXferProcessor generated from this fac
tory will be able to | 320 * This function returns true if the GrXferProcessor generated from this fac
tory will be able to |
| 321 * correctly blend when using RGB coverage. The knownColor and knownColorFla
gs represent the | 321 * correctly blend when using RGB coverage. The knownColor and knownColorFla
gs represent the |
| 322 * final computed color from the color stages. | 322 * final computed color from the color stages. |
| 323 */ | 323 */ |
| 324 virtual bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlag
s) const = 0; | 324 virtual bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlag
s) const = 0; |
| 325 | 325 |
| 326 /** | 326 /** |
| 327 * Known color information after blending, but before accounting for any cov
erage. | 327 * Known color information after blending, but before accounting for any cov
erage. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 fClassID = kClassID; | 366 fClassID = kClassID; |
| 367 } | 367 } |
| 368 | 368 |
| 369 uint32_t fClassID; | 369 uint32_t fClassID; |
| 370 | 370 |
| 371 private: | 371 private: |
| 372 virtual GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, | 372 virtual GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, |
| 373 const GrProcOptInfo& colorPOI
, | 373 const GrProcOptInfo& colorPOI
, |
| 374 const GrProcOptInfo& coverage
POI, | 374 const GrProcOptInfo& coverage
POI, |
| 375 bool hasMixedSamples, | 375 bool hasMixedSamples, |
| 376 const DstTexture*) const = 0; | 376 const DstTexture*, GrRenderTa
rget* dst) const = 0; |
| 377 /** | 377 /** |
| 378 * Returns true if the XP generated by this factory will explicitly read ds
t in the fragment | 378 * Returns true if the XP generated by this factory will explicitly read ds
t in the fragment |
| 379 * shader. | 379 * shader. |
| 380 */ | 380 */ |
| 381 virtual bool willReadDstColor(const GrCaps& caps, | 381 virtual bool willReadDstColor(const GrCaps& caps, |
| 382 const GrProcOptInfo& colorPOI, | 382 const GrProcOptInfo& colorPOI, |
| 383 const GrProcOptInfo& coveragePOI, | 383 const GrProcOptInfo& coveragePOI, |
| 384 bool hasMixedSamples) const = 0; | 384 bool hasMixedSamples) const = 0; |
| 385 | 385 |
| 386 virtual bool onIsEqual(const GrXPFactory&) const = 0; | 386 virtual bool onIsEqual(const GrXPFactory&) const = 0; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 400 enum { | 400 enum { |
| 401 kIllegalXPFClassID = 0, | 401 kIllegalXPFClassID = 0, |
| 402 }; | 402 }; |
| 403 static int32_t gCurrXPFClassID; | 403 static int32_t gCurrXPFClassID; |
| 404 | 404 |
| 405 typedef GrProgramElement INHERITED; | 405 typedef GrProgramElement INHERITED; |
| 406 }; | 406 }; |
| 407 | 407 |
| 408 #endif | 408 #endif |
| 409 | 409 |
| OLD | NEW |