| OLD | NEW |
| 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 "SkBlitter.h" | 10 #include "SkBlitter.h" |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 // innerBlitter was allocated by allocator, which will delete it. | 989 // innerBlitter was allocated by allocator, which will delete it. |
| 990 // We know shaderContext is of type Sk3DShaderContext because it belongs
to shader3D. | 990 // We know shaderContext is of type Sk3DShaderContext because it belongs
to shader3D. |
| 991 blitter = allocator->createT<Sk3DBlitter>(innerBlitter, | 991 blitter = allocator->createT<Sk3DBlitter>(innerBlitter, |
| 992 static_cast<Sk3DShader::Sk3DShaderContext*>(shaderContext)); | 992 static_cast<Sk3DShader::Sk3DShaderContext*>(shaderContext)); |
| 993 } | 993 } |
| 994 return blitter; | 994 return blitter; |
| 995 } | 995 } |
| 996 | 996 |
| 997 /////////////////////////////////////////////////////////////////////////////// | 997 /////////////////////////////////////////////////////////////////////////////// |
| 998 | 998 |
| 999 const uint16_t gMask_0F0F = 0xF0F; | |
| 1000 const uint32_t gMask_00FF00FF = 0xFF00FF; | |
| 1001 | |
| 1002 /////////////////////////////////////////////////////////////////////////////// | |
| 1003 | |
| 1004 class SkTransparentShaderContext : public SkShader::Context { | 999 class SkTransparentShaderContext : public SkShader::Context { |
| 1005 public: | 1000 public: |
| 1006 SkTransparentShaderContext(const SkShader& shader, const SkShader::ContextRe
c& rec) | 1001 SkTransparentShaderContext(const SkShader& shader, const SkShader::ContextRe
c& rec) |
| 1007 : INHERITED(shader, rec) {} | 1002 : INHERITED(shader, rec) {} |
| 1008 | 1003 |
| 1009 virtual void shadeSpan(int x, int y, SkPMColor colors[], int count) SK_OVERR
IDE { | 1004 virtual void shadeSpan(int x, int y, SkPMColor colors[], int count) SK_OVERR
IDE { |
| 1010 sk_bzero(colors, count * sizeof(SkPMColor)); | 1005 sk_bzero(colors, count * sizeof(SkPMColor)); |
| 1011 } | 1006 } |
| 1012 | 1007 |
| 1013 private: | 1008 private: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1041 // shader to create it. It is therefore safe to re-use the storage. | 1036 // shader to create it. It is therefore safe to re-use the storage. |
| 1042 fShaderContext->~Context(); | 1037 fShaderContext->~Context(); |
| 1043 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); | 1038 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); |
| 1044 if (NULL == ctx) { | 1039 if (NULL == ctx) { |
| 1045 // Need a valid context in fShaderContext's storage, so we can later (or
our caller) call | 1040 // Need a valid context in fShaderContext's storage, so we can later (or
our caller) call |
| 1046 // the in-place destructor. | 1041 // the in-place destructor. |
| 1047 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad
er, rec)); | 1042 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad
er, rec)); |
| 1048 } | 1043 } |
| 1049 return ctx != NULL; | 1044 return ctx != NULL; |
| 1050 } | 1045 } |
| OLD | NEW |