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

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: 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 void SkPaint2GrPaintNoShader(GrContext* context, GrRenderTarget* rt, const SkPai nt& skPaint, 645 void 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 xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrcOver_Mode); 655 xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrcOver_Mode);
656 } 656 }
657 SkASSERT(xpFactory); 657 SkASSERT(xpFactory);
658 grPaint->setXPFactory(xpFactory)->unref(); 658 grPaint->setXPFactory(xpFactory)->unref();
659 659
660 //set the color of the paint to the one of the parameter 660 //set the color of the paint to the one of the parameter
661 grPaint->setColor(paintColor); 661 grPaint->setColor(paintColor);
662 662
663 SkColorFilter* colorFilter = skPaint.getColorFilter(); 663 SkColorFilter* colorFilter = skPaint.getColorFilter();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) { 722 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) {
723 grPaint->addColorProcessor(fp)->unref(); 723 grPaint->addColorProcessor(fp)->unref();
724 constantColor = false; 724 constantColor = false;
725 } 725 }
726 } 726 }
727 727
728 // The grcolor is automatically set when calling asFragmentProcessor. 728 // The grcolor is automatically set when calling asFragmentProcessor.
729 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. 729 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint.
730 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint); 730 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint);
731 } 731 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698