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

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

Issue 759713002: Make all blending up to GrOptDrawState be handled by the xp/xp factory. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: rebase Created 6 years 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/GrProcOptInfo.cpp ('k') | src/gpu/SkGr.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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "effects/GrBicubicEffect.h" 10 #include "effects/GrBicubicEffect.h"
11 #include "effects/GrDashingEffect.h" 11 #include "effects/GrDashingEffect.h"
12 #include "effects/GrPorterDuffXferProcessor.h"
12 #include "effects/GrTextureDomain.h" 13 #include "effects/GrTextureDomain.h"
13 #include "effects/GrSimpleTextureEffect.h" 14 #include "effects/GrSimpleTextureEffect.h"
14 15
15 #include "GrContext.h" 16 #include "GrContext.h"
16 #include "GrBitmapTextContext.h" 17 #include "GrBitmapTextContext.h"
17 #include "GrDistanceFieldTextContext.h" 18 #include "GrDistanceFieldTextContext.h"
18 #include "GrLayerHoister.h" 19 #include "GrLayerHoister.h"
19 #include "GrRecordReplaceDraw.h" 20 #include "GrRecordReplaceDraw.h"
20 #include "GrStrokeInfo.h" 21 #include "GrStrokeInfo.h"
21 #include "GrTracing.h" 22 #include "GrTracing.h"
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 667
667 GrPaint tempPaint; 668 GrPaint tempPaint;
668 if (doAA) { 669 if (doAA) {
669 tempPaint.setAntiAlias(true); 670 tempPaint.setAntiAlias(true);
670 // AA uses the "coverage" stages on GrDrawTarget. Coverage with a dst 671 // AA uses the "coverage" stages on GrDrawTarget. Coverage with a dst
671 // blend coeff of zero requires dual source blending support in order 672 // blend coeff of zero requires dual source blending support in order
672 // to properly blend partially covered pixels. This means the AA 673 // to properly blend partially covered pixels. This means the AA
673 // code path may not be taken. So we use a dst blend coeff of ISA. We 674 // code path may not be taken. So we use a dst blend coeff of ISA. We
674 // could special case AA draws to a dst surface with known alpha=0 to 675 // could special case AA draws to a dst surface with known alpha=0 to
675 // use a zero dst coeff when dual source blending isn't available. 676 // use a zero dst coeff when dual source blending isn't available.
676 tempPaint.setBlendFunc(kOne_GrBlendCoeff, kISC_GrBlendCoeff); 677 tempPaint.setPorterDuffXPFactory(kOne_GrBlendCoeff, kISC_GrBlendCoeff);
677 } 678 }
678 679
679 GrContext::AutoMatrix am; 680 GrContext::AutoMatrix am;
680 681
681 // Draw the mask into maskTexture with the path's top-left at the origin usi ng tempPaint. 682 // Draw the mask into maskTexture with the path's top-left at the origin usi ng tempPaint.
682 SkMatrix translate; 683 SkMatrix translate;
683 translate.setTranslate(-maskRect.fLeft, -maskRect.fTop); 684 translate.setTranslate(-maskRect.fLeft, -maskRect.fTop);
684 am.set(context, translate); 685 am.set(context, translate);
685 context->drawPath(tempPaint, devPath, strokeInfo); 686 context->drawPath(tempPaint, devPath, strokeInfo);
686 return mask; 687 return mask;
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 #endif 1881 #endif
1881 } 1882 }
1882 1883
1883 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1884 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1884 // We always return a transient cache, so it is freed after each 1885 // We always return a transient cache, so it is freed after each
1885 // filter traversal. 1886 // filter traversal.
1886 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 1887 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
1887 } 1888 }
1888 1889
1889 #endif 1890 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrProcOptInfo.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698