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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 return SkNEW_ARGS(Sk3DShader, (shader)); | 729 return SkNEW_ARGS(Sk3DShader, (shader)); |
730 } | 730 } |
731 | 731 |
732 class Sk3DBlitter : public SkBlitter { | 732 class Sk3DBlitter : public SkBlitter { |
733 public: | 733 public: |
734 Sk3DBlitter(SkBlitter* proxy, SkShader::Context* shaderContext) | 734 Sk3DBlitter(SkBlitter* proxy, SkShader::Context* shaderContext) |
735 : fProxy(proxy) | 735 : fProxy(proxy) |
736 , fShaderContext(shaderContext) | 736 , fShaderContext(shaderContext) |
737 {} | 737 {} |
738 | 738 |
739 virtual void blitH(int x, int y, int width) { | 739 virtual void blitH(int x, int y, int width) SK_OVERRIDE { |
740 fProxy->blitH(x, y, width); | 740 fProxy->blitH(x, y, width); |
741 } | 741 } |
742 | 742 |
743 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], | 743 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], |
744 const int16_t runs[]) { | 744 const int16_t runs[]) SK_OVERRIDE { |
745 fProxy->blitAntiH(x, y, antialias, runs); | 745 fProxy->blitAntiH(x, y, antialias, runs); |
746 } | 746 } |
747 | 747 |
748 virtual void blitV(int x, int y, int height, SkAlpha alpha) { | 748 virtual void blitV(int x, int y, int height, SkAlpha alpha) SK_OVERRIDE { |
749 fProxy->blitV(x, y, height, alpha); | 749 fProxy->blitV(x, y, height, alpha); |
750 } | 750 } |
751 | 751 |
752 virtual void blitRect(int x, int y, int width, int height) { | 752 virtual void blitRect(int x, int y, int width, int height) SK_OVERRIDE { |
753 fProxy->blitRect(x, y, width, height); | 753 fProxy->blitRect(x, y, width, height); |
754 } | 754 } |
755 | 755 |
756 virtual void blitMask(const SkMask& mask, const SkIRect& clip) { | 756 virtual void blitMask(const SkMask& mask, const SkIRect& clip) SK_OVERRIDE { |
757 if (mask.fFormat == SkMask::k3D_Format) { | 757 if (mask.fFormat == SkMask::k3D_Format) { |
758 fShaderContext->set3DMask(&mask); | 758 fShaderContext->set3DMask(&mask); |
759 | 759 |
760 ((SkMask*)&mask)->fFormat = SkMask::kA8_Format; | 760 ((SkMask*)&mask)->fFormat = SkMask::kA8_Format; |
761 fProxy->blitMask(mask, clip); | 761 fProxy->blitMask(mask, clip); |
762 ((SkMask*)&mask)->fFormat = SkMask::k3D_Format; | 762 ((SkMask*)&mask)->fFormat = SkMask::k3D_Format; |
763 | 763 |
764 fShaderContext->set3DMask(NULL); | 764 fShaderContext->set3DMask(NULL); |
765 } else { | 765 } else { |
766 fProxy->blitMask(mask, clip); | 766 fProxy->blitMask(mask, clip); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 fShaderContext->~Context(); | 1026 fShaderContext->~Context(); |
1027 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); | 1027 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); |
1028 if (NULL == ctx) { | 1028 if (NULL == ctx) { |
1029 // 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 |
1030 // the in-place destructor. | 1030 // the in-place destructor. |
1031 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad
er, rec)); | 1031 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad
er, rec)); |
1032 return false; | 1032 return false; |
1033 } | 1033 } |
1034 return true; | 1034 return true; |
1035 } | 1035 } |
OLD | NEW |