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

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

Issue 766653008: Revert of 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: 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"
13 #include "effects/GrTextureDomain.h" 12 #include "effects/GrTextureDomain.h"
14 #include "effects/GrSimpleTextureEffect.h" 13 #include "effects/GrSimpleTextureEffect.h"
15 14
16 #include "GrContext.h" 15 #include "GrContext.h"
17 #include "GrBitmapTextContext.h" 16 #include "GrBitmapTextContext.h"
18 #include "GrDistanceFieldTextContext.h" 17 #include "GrDistanceFieldTextContext.h"
19 #include "GrLayerHoister.h" 18 #include "GrLayerHoister.h"
20 #include "GrRecordReplaceDraw.h" 19 #include "GrRecordReplaceDraw.h"
21 #include "GrStrokeInfo.h" 20 #include "GrStrokeInfo.h"
22 #include "GrTracing.h" 21 #include "GrTracing.h"
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 666
668 GrPaint tempPaint; 667 GrPaint tempPaint;
669 if (doAA) { 668 if (doAA) {
670 tempPaint.setAntiAlias(true); 669 tempPaint.setAntiAlias(true);
671 // AA uses the "coverage" stages on GrDrawTarget. Coverage with a dst 670 // AA uses the "coverage" stages on GrDrawTarget. Coverage with a dst
672 // blend coeff of zero requires dual source blending support in order 671 // blend coeff of zero requires dual source blending support in order
673 // to properly blend partially covered pixels. This means the AA 672 // to properly blend partially covered pixels. This means the AA
674 // code path may not be taken. So we use a dst blend coeff of ISA. We 673 // code path may not be taken. So we use a dst blend coeff of ISA. We
675 // could special case AA draws to a dst surface with known alpha=0 to 674 // could special case AA draws to a dst surface with known alpha=0 to
676 // use a zero dst coeff when dual source blending isn't available. 675 // use a zero dst coeff when dual source blending isn't available.
677 tempPaint.setPorterDuffXPFactory(kOne_GrBlendCoeff, kISC_GrBlendCoeff); 676 tempPaint.setBlendFunc(kOne_GrBlendCoeff, kISC_GrBlendCoeff);
678 } 677 }
679 678
680 GrContext::AutoMatrix am; 679 GrContext::AutoMatrix am;
681 680
682 // Draw the mask into maskTexture with the path's top-left at the origin usi ng tempPaint. 681 // Draw the mask into maskTexture with the path's top-left at the origin usi ng tempPaint.
683 SkMatrix translate; 682 SkMatrix translate;
684 translate.setTranslate(-maskRect.fLeft, -maskRect.fTop); 683 translate.setTranslate(-maskRect.fLeft, -maskRect.fTop);
685 am.set(context, translate); 684 am.set(context, translate);
686 context->drawPath(tempPaint, devPath, strokeInfo); 685 context->drawPath(tempPaint, devPath, strokeInfo);
687 return mask; 686 return mask;
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 #endif 1880 #endif
1882 } 1881 }
1883 1882
1884 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1883 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1885 // We always return a transient cache, so it is freed after each 1884 // We always return a transient cache, so it is freed after each
1886 // filter traversal. 1885 // filter traversal.
1887 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 1886 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
1888 } 1887 }
1889 1888
1890 #endif 1889 #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