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

Side by Side Diff: src/gpu/effects/GrCustomXfermode.cpp

Issue 1049143002: Add onGetBlendInfo to GrXferProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_nvbea_tokens
Patch Set: rebase Created 5 years, 8 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/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrDisableColorXP.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 2015 Google Inc. 2 * Copyright 2015 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 "effects/GrCustomXfermode.h" 8 #include "effects/GrCustomXfermode.h"
9 #include "effects/GrCustomXfermodePriv.h" 9 #include "effects/GrCustomXfermodePriv.h"
10 10
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 GrGLXferProcessor* createGLInstance() const override; 502 GrGLXferProcessor* createGLInstance() const override;
503 503
504 bool hasSecondaryOutput() const override { return false; } 504 bool hasSecondaryOutput() const override { return false; }
505 505
506 GrXferProcessor::OptFlags getOptimizations(const GrProcOptInfo& colorPOI, 506 GrXferProcessor::OptFlags getOptimizations(const GrProcOptInfo& colorPOI,
507 const GrProcOptInfo& coveragePOI, 507 const GrProcOptInfo& coveragePOI,
508 bool doesStencilWrite, 508 bool doesStencilWrite,
509 GrColor* overrideColor, 509 GrColor* overrideColor,
510 const GrDrawTargetCaps& caps) ove rride; 510 const GrDrawTargetCaps& caps) ove rride;
511 511
512 void getBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const override {
513 blendInfo->fSrcBlend = kOne_GrBlendCoeff;
514 blendInfo->fDstBlend = kZero_GrBlendCoeff;
515 blendInfo->fBlendConstant = 0;
516 }
517
518 SkXfermode::Mode mode() const { return fMode; } 512 SkXfermode::Mode mode() const { return fMode; }
519 513
520 private: 514 private:
521 CustomXP(SkXfermode::Mode mode, const GrDeviceCoordTexture* dstCopy, bool wi llReadDstColor); 515 CustomXP(SkXfermode::Mode mode, const GrDeviceCoordTexture* dstCopy, bool wi llReadDstColor);
522 516
523 void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) con st override; 517 void onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) con st override;
524 518
525 bool onIsEqual(const GrXferProcessor& xpBase) const override; 519 bool onIsEqual(const GrXferProcessor& xpBase) const override;
526 520
527 SkXfermode::Mode fMode; 521 SkXfermode::Mode fMode;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory); 620 GR_DEFINE_XP_FACTORY_TEST(GrCustomXPFactory);
627 GrXPFactory* GrCustomXPFactory::TestCreate(SkRandom* rand, 621 GrXPFactory* GrCustomXPFactory::TestCreate(SkRandom* rand,
628 GrContext*, 622 GrContext*,
629 const GrDrawTargetCaps&, 623 const GrDrawTargetCaps&,
630 GrTexture*[]) { 624 GrTexture*[]) {
631 int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLas tSeparableMode); 625 int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLas tSeparableMode);
632 626
633 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode))); 627 return SkNEW_ARGS(GrCustomXPFactory, (static_cast<SkXfermode::Mode>(mode)));
634 } 628 }
635 629
OLDNEW
« no previous file with comments | « src/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrDisableColorXP.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698