| 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 "SkAtomics.h" | 8 #include "SkAtomics.h" |
| 9 #include "SkBitmapProcShader.h" | 9 #include "SkBitmapProcShader.h" |
| 10 #include "SkColorShader.h" | 10 #include "SkColorShader.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 fPaintAlpha = rec.fPaint->getAlpha(); | 111 fPaintAlpha = rec.fPaint->getAlpha(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 SkShader::Context::~Context() {} | 114 SkShader::Context::~Context() {} |
| 115 | 115 |
| 116 SkShader::Context::ShadeProc SkShader::Context::asAShadeProc(void** ctx) { | 116 SkShader::Context::ShadeProc SkShader::Context::asAShadeProc(void** ctx) { |
| 117 return nullptr; | 117 return nullptr; |
| 118 } | 118 } |
| 119 | 119 |
| 120 void SkShader::Context::shadeSpan4f(int x, int y, SkPM4f[], int count) { | 120 void SkShader::Context::shadeSpan4f(int x, int y, SkPM4f dst[], int count) { |
| 121 SkASSERT(false && "shadeSpan4f called but not implemented"); | 121 const int N = 128; |
| 122 SkPMColor tmp[N]; |
| 123 while (count > 0) { |
| 124 int n = SkTMin(count, N); |
| 125 this->shadeSpan(x, y, tmp, n); |
| 126 for (int i = 0; i < n; ++i) { |
| 127 dst[i] = SkPM4f::FromPMColor(tmp[i]); |
| 128 } |
| 129 dst += n; |
| 130 x += n; |
| 131 count -= n; |
| 132 } |
| 122 } | 133 } |
| 123 | 134 |
| 124 #include "SkColorPriv.h" | 135 #include "SkColorPriv.h" |
| 125 | 136 |
| 126 #define kTempColorQuadCount 6 // balance between speed (larger) and saving sta
ck-space | 137 #define kTempColorQuadCount 6 // balance between speed (larger) and saving sta
ck-space |
| 127 #define kTempColorCount (kTempColorQuadCount << 2) | 138 #define kTempColorCount (kTempColorQuadCount << 2) |
| 128 | 139 |
| 129 #ifdef SK_CPU_BENDIAN | 140 #ifdef SK_CPU_BENDIAN |
| 130 #define SkU32BitShiftToByteOffset(shift) (3 - ((shift) >> 3)) | 141 #define SkU32BitShiftToByteOffset(shift) (3 - ((shift) >> 3)) |
| 131 #else | 142 #else |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 #include "SkEmptyShader.h" | 365 #include "SkEmptyShader.h" |
| 355 | 366 |
| 356 void SkEmptyShader::toString(SkString* str) const { | 367 void SkEmptyShader::toString(SkString* str) const { |
| 357 str->append("SkEmptyShader: ("); | 368 str->append("SkEmptyShader: ("); |
| 358 | 369 |
| 359 this->INHERITED::toString(str); | 370 this->INHERITED::toString(str); |
| 360 | 371 |
| 361 str->append(")"); | 372 str->append(")"); |
| 362 } | 373 } |
| 363 #endif | 374 #endif |
| OLD | NEW |