Index: src/core/SkFilterShader.cpp |
diff --git a/src/core/SkColorFilter.cpp b/src/core/SkFilterShader.cpp |
similarity index 69% |
copy from src/core/SkColorFilter.cpp |
copy to src/core/SkFilterShader.cpp |
index 383397dbcae59854e923c04df42b69c78c9ef6b3..4fcb9361f199f849a35240ec6096aa86a1f03a04 100644 |
--- a/src/core/SkColorFilter.cpp |
+++ b/src/core/SkFilterShader.cpp |
@@ -1,59 +1,27 @@ |
/* |
- * Copyright 2006 The Android Open Source Project |
+ * Copyright 2013 Google Inc. |
* |
* Use of this source code is governed by a BSD-style license that can be |
* found in the LICENSE file. |
*/ |
-#include "SkColorFilter.h" |
#include "SkFilterShader.h" |
+ |
+#include "SkColorFilter.h" |
#include "SkFlattenableBuffers.h" |
#include "SkShader.h" |
-#include "SkUnPreMultiply.h" |
#include "SkString.h" |
-SK_DEFINE_INST_COUNT(SkColorFilter) |
- |
-bool SkColorFilter::asColorMode(SkColor* color, SkXfermode::Mode* mode) const { |
- return false; |
-} |
- |
-bool SkColorFilter::asColorMatrix(SkScalar matrix[20]) const { |
- return false; |
-} |
- |
-bool SkColorFilter::asComponentTable(SkBitmap*) const { |
- return false; |
-} |
- |
-void SkColorFilter::filterSpan16(const uint16_t s[], int count, uint16_t d[]) const { |
- SkASSERT(this->getFlags() & SkColorFilter::kHasFilter16_Flag); |
- SkDEBUGFAIL("missing implementation of SkColorFilter::filterSpan16"); |
- |
- if (d != s) { |
- memcpy(d, s, count * sizeof(uint16_t)); |
- } |
-} |
- |
-SkColor SkColorFilter::filterColor(SkColor c) const { |
- SkPMColor dst, src = SkPreMultiplyColor(c); |
- this->filterSpan(&src, 1, &dst); |
- return SkUnPreMultiply::PMColorToColor(dst); |
-} |
- |
-GrEffectRef* SkColorFilter::asNewEffect(GrContext*) const { |
- return NULL; |
-} |
- |
-/////////////////////////////////////////////////////////////////////////////// |
- |
SkFilterShader::SkFilterShader(SkShader* shader, SkColorFilter* filter) { |
- fShader = shader; shader->ref(); |
- fFilter = filter; filter->ref(); |
+ fShader = shader; |
+ shader->ref(); |
+ |
+ fFilter = filter; |
+ filter->ref(); |
} |
-SkFilterShader::SkFilterShader(SkFlattenableReadBuffer& buffer) : |
- INHERITED(buffer) { |
+SkFilterShader::SkFilterShader(SkFlattenableReadBuffer& buffer) |
+ : INHERITED(buffer) { |
fShader = buffer.readFlattenableT<SkShader>(); |
fFilter = buffer.readFlattenableT<SkColorFilter>(); |
} |