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

Side by Side Diff: src/gpu/SkGr.cpp

Issue 1037123003: Implement support for KHR_blend_equation_advanced (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_zzz2_barriers
Patch Set: Addressed comments 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
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 "SkGr.h" 8 #include "SkGr.h"
9 9
10 #include "GrXferProcessor.h" 10 #include "GrXferProcessor.h"
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 /////////////////////////////////////////////////////////////////////////////// 643 ///////////////////////////////////////////////////////////////////////////////
644 644
645 bool SkPaint2GrPaintNoShader(GrContext* context, GrRenderTarget* rt, const SkPai nt& skPaint, 645 bool SkPaint2GrPaintNoShader(GrContext* context, GrRenderTarget* rt, const SkPai nt& skPaint,
646 GrColor paintColor, bool constantColor, GrPaint* gr Paint) { 646 GrColor paintColor, bool constantColor, GrPaint* gr Paint) {
647 647
648 grPaint->setDither(skPaint.isDither()); 648 grPaint->setDither(skPaint.isDither());
649 grPaint->setAntiAlias(skPaint.isAntiAlias()); 649 grPaint->setAntiAlias(skPaint.isAntiAlias());
650 650
651 SkXfermode* mode = skPaint.getXfermode(); 651 SkXfermode* mode = skPaint.getXfermode();
652 GrXPFactory* xpFactory = NULL; 652 GrXPFactory* xpFactory = NULL;
653 if (!SkXfermode::AsXPFactory(mode, &xpFactory)) { 653 if (!SkXfermode::AsXPFactory(mode, context, &xpFactory)) {
654 // Fall back to src-over 654 // Fall back to src-over
655 // return false here? 655 // return false here?
656 xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrcOver_Mode); 656 xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrcOver_Mode);
657 } 657 }
658 SkASSERT(xpFactory); 658 SkASSERT(xpFactory);
659 grPaint->setXPFactory(xpFactory)->unref(); 659 grPaint->setXPFactory(xpFactory)->unref();
660 660
661 //set the color of the paint to the one of the parameter 661 //set the color of the paint to the one of the parameter
662 grPaint->setColor(paintColor); 662 grPaint->setColor(paintColor);
663 663
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 if (fp) { 727 if (fp) {
728 grPaint->addColorProcessor(fp)->unref(); 728 grPaint->addColorProcessor(fp)->unref();
729 constantColor = false; 729 constantColor = false;
730 } 730 }
731 } 731 }
732 732
733 // The grcolor is automatically set when calling asFragmentProcessor. 733 // The grcolor is automatically set when calling asFragmentProcessor.
734 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. 734 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint.
735 return SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantCol or, grPaint); 735 return SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantCol or, grPaint);
736 } 736 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698