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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
714 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Sk3DShader) | 714 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Sk3DShader) |
715 | 715 |
716 protected: | 716 protected: |
717 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
718 Sk3DShader(SkReadBuffer& buffer) : INHERITED(buffer) { | |
719 fProxy = buffer.readShader(); | |
720 // Leaving this here until we bump the picture version, though this | |
721 // shader should never be recorded. | |
722 buffer.readColor(); | |
723 } | |
724 #endif | |
725 | |
726 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { | 717 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { |
727 buffer.writeFlattenable(fProxy); | 718 buffer.writeFlattenable(fProxy); |
728 } | 719 } |
729 | 720 |
730 private: | 721 private: |
731 SkShader* fProxy; | 722 SkShader* fProxy; |
732 | 723 |
733 typedef SkShader INHERITED; | 724 typedef SkShader INHERITED; |
734 }; | 725 }; |
735 | 726 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 fShaderContext->~Context(); | 1026 fShaderContext->~Context(); |
1036 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); | 1027 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); |
1037 if (NULL == ctx) { | 1028 if (NULL == ctx) { |
1038 // Need a valid context in fShaderContext's storage, so we can later (or
our caller) call | 1029 // Need a valid context in fShaderContext's storage, so we can later (or
our caller) call |
1039 // the in-place destructor. | 1030 // the in-place destructor. |
1040 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad
er, rec)); | 1031 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad
er, rec)); |
1041 return false; | 1032 return false; |
1042 } | 1033 } |
1043 return true; | 1034 return true; |
1044 } | 1035 } |
OLD | NEW |