| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkBlitter.h" | 8 #include "SkBlitter.h" |
| 9 #include "SkAntiRun.h" | 9 #include "SkAntiRun.h" |
| 10 #include "SkColor.h" | 10 #include "SkColor.h" |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 SkShader::Context* fProxyContext; | 693 SkShader::Context* fProxyContext; |
| 694 SkPMColor fPMColor; | 694 SkPMColor fPMColor; |
| 695 | 695 |
| 696 typedef SkShader::Context INHERITED; | 696 typedef SkShader::Context INHERITED; |
| 697 }; | 697 }; |
| 698 | 698 |
| 699 #ifndef SK_IGNORE_TO_STRING | 699 #ifndef SK_IGNORE_TO_STRING |
| 700 virtual void toString(SkString* str) const SK_OVERRIDE { | 700 virtual void toString(SkString* str) const SK_OVERRIDE { |
| 701 str->append("Sk3DShader: ("); | 701 str->append("Sk3DShader: ("); |
| 702 | 702 |
| 703 if (NULL != fProxy) { | 703 if (fProxy) { |
| 704 str->append("Proxy: "); | 704 str->append("Proxy: "); |
| 705 fProxy->toString(str); | 705 fProxy->toString(str); |
| 706 } | 706 } |
| 707 | 707 |
| 708 this->INHERITED::toString(str); | 708 this->INHERITED::toString(str); |
| 709 | 709 |
| 710 str->append(")"); | 710 str->append(")"); |
| 711 } | 711 } |
| 712 #endif | 712 #endif |
| 713 | 713 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 SkTCopyOnFirstWrite<SkPaint> paint(origPaint); | 868 SkTCopyOnFirstWrite<SkPaint> paint(origPaint); |
| 869 | 869 |
| 870 if (origPaint.getMaskFilter() != NULL && | 870 if (origPaint.getMaskFilter() != NULL && |
| 871 origPaint.getMaskFilter()->getFormat() == SkMask::k3D_Format) { | 871 origPaint.getMaskFilter()->getFormat() == SkMask::k3D_Format) { |
| 872 shader3D = SkNEW_ARGS(Sk3DShader, (shader)); | 872 shader3D = SkNEW_ARGS(Sk3DShader, (shader)); |
| 873 // we know we haven't initialized lazyPaint yet, so just do it | 873 // we know we haven't initialized lazyPaint yet, so just do it |
| 874 paint.writable()->setShader(shader3D)->unref(); | 874 paint.writable()->setShader(shader3D)->unref(); |
| 875 shader = shader3D; | 875 shader = shader3D; |
| 876 } | 876 } |
| 877 | 877 |
| 878 if (NULL != mode) { | 878 if (mode) { |
| 879 switch (interpret_xfermode(*paint, mode, device.colorType())) { | 879 switch (interpret_xfermode(*paint, mode, device.colorType())) { |
| 880 case kSrcOver_XferInterp: | 880 case kSrcOver_XferInterp: |
| 881 mode = NULL; | 881 mode = NULL; |
| 882 paint.writable()->setXfermode(NULL); | 882 paint.writable()->setXfermode(NULL); |
| 883 break; | 883 break; |
| 884 case kSkipDrawing_XferInterp:{ | 884 case kSkipDrawing_XferInterp:{ |
| 885 blitter = allocator->createT<SkNullBlitter>(); | 885 blitter = allocator->createT<SkNullBlitter>(); |
| 886 return blitter; | 886 return blitter; |
| 887 } | 887 } |
| 888 default: | 888 default: |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 fShaderContext->~Context(); | 1035 fShaderContext->~Context(); |
| 1036 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); | 1036 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); |
| 1037 if (NULL == ctx) { | 1037 if (NULL == ctx) { |
| 1038 // Need a valid context in fShaderContext's storage, so we can later (or
our caller) call | 1038 // Need a valid context in fShaderContext's storage, so we can later (or
our caller) call |
| 1039 // the in-place destructor. | 1039 // the in-place destructor. |
| 1040 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad
er, rec)); | 1040 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad
er, rec)); |
| 1041 return false; | 1041 return false; |
| 1042 } | 1042 } |
| 1043 return true; | 1043 return true; |
| 1044 } | 1044 } |
| OLD | NEW |