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

Side by Side Diff: src/core/SkXfermode.cpp

Issue 31853003: Remove GrContext from SkXfermode::[Aa]sNewEffectOrCoeff() and all subclasses, (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkXfermode.h ('k') | src/core/SkXfermode_proccoeff.h » ('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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkXfermode.h" 10 #include "SkXfermode.h"
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 /////////////////////////////////////////////////////////////////////////////// 666 ///////////////////////////////////////////////////////////////////////////////
667 667
668 bool SkXfermode::asCoeff(Coeff* src, Coeff* dst) const { 668 bool SkXfermode::asCoeff(Coeff* src, Coeff* dst) const {
669 return false; 669 return false;
670 } 670 }
671 671
672 bool SkXfermode::asMode(Mode* mode) const { 672 bool SkXfermode::asMode(Mode* mode) const {
673 return false; 673 return false;
674 } 674 }
675 675
676 bool SkXfermode::asNewEffectOrCoeff(GrContext*, GrEffectRef**, Coeff* src, Coeff * dst, GrTexture*) const { 676 bool SkXfermode::asNewEffectOrCoeff(GrEffectRef**, Coeff* src, Coeff* dst, GrTex ture*) const {
677 return this->asCoeff(src, dst); 677 return this->asCoeff(src, dst);
678 } 678 }
679 679
680 bool SkXfermode::AsNewEffectOrCoeff(SkXfermode* xfermode, 680 bool SkXfermode::AsNewEffectOrCoeff(SkXfermode* xfermode,
681 GrContext* context,
682 GrEffectRef** effect, 681 GrEffectRef** effect,
683 Coeff* src, 682 Coeff* src,
684 Coeff* dst, 683 Coeff* dst,
685 GrTexture* background) { 684 GrTexture* background) {
686 if (NULL == xfermode) { 685 if (NULL == xfermode) {
687 return ModeAsCoeff(kSrcOver_Mode, src, dst); 686 return ModeAsCoeff(kSrcOver_Mode, src, dst);
688 } else { 687 } else {
689 return xfermode->asNewEffectOrCoeff(context, effect, src, dst, backgroun d); 688 return xfermode->asNewEffectOrCoeff(effect, src, dst, background);
690 } 689 }
691 } 690 }
692 691
693 SkPMColor SkXfermode::xferColor(SkPMColor src, SkPMColor dst) const{ 692 SkPMColor SkXfermode::xferColor(SkPMColor src, SkPMColor dst) const{
694 // no-op. subclasses should override this 693 // no-op. subclasses should override this
695 return dst; 694 return dst;
696 } 695 }
697 696
698 void SkXfermode::xfer32(SkPMColor* SK_RESTRICT dst, 697 void SkXfermode::xfer32(SkPMColor* SK_RESTRICT dst,
699 const SkPMColor* SK_RESTRICT src, int count, 698 const SkPMColor* SK_RESTRICT src, int count,
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 if (sc) { 1356 if (sc) {
1358 *sc = fSrcCoeff; 1357 *sc = fSrcCoeff;
1359 } 1358 }
1360 if (dc) { 1359 if (dc) {
1361 *dc = fDstCoeff; 1360 *dc = fDstCoeff;
1362 } 1361 }
1363 return true; 1362 return true;
1364 } 1363 }
1365 1364
1366 #if SK_SUPPORT_GPU 1365 #if SK_SUPPORT_GPU
1367 bool SkProcCoeffXfermode::asNewEffectOrCoeff(GrContext*, 1366 bool SkProcCoeffXfermode::asNewEffectOrCoeff(GrEffectRef** effect,
1368 GrEffectRef** effect,
1369 Coeff* src, 1367 Coeff* src,
1370 Coeff* dst, 1368 Coeff* dst,
1371 GrTexture* background) const { 1369 GrTexture* background) const {
1372 if (this->asCoeff(src, dst)) { 1370 if (this->asCoeff(src, dst)) {
1373 return true; 1371 return true;
1374 } 1372 }
1375 if (XferEffect::IsSupportedMode(fMode)) { 1373 if (XferEffect::IsSupportedMode(fMode)) {
1376 if (NULL != effect) { 1374 if (NULL != effect) {
1377 *effect = XferEffect::Create(fMode, background); 1375 *effect = XferEffect::Create(fMode, background);
1378 SkASSERT(NULL != *effect); 1376 SkASSERT(NULL != *effect);
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) 1950 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode)
1953 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) 1951 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode)
1954 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode) 1952 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode)
1955 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode) 1953 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode)
1956 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode) 1954 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode)
1957 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode) 1955 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode)
1958 #if !SK_ARM_NEON_IS_NONE 1956 #if !SK_ARM_NEON_IS_NONE
1959 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkNEONProcCoeffXfermode) 1957 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkNEONProcCoeffXfermode)
1960 #endif 1958 #endif
1961 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1959 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « include/core/SkXfermode.h ('k') | src/core/SkXfermode_proccoeff.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698