Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: src/core/SkFilterShader.cpp

Issue 19305004: Move implementation of SkFilterShader into its source file. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkColorFilter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>();
}
« no previous file with comments | « src/core/SkColorFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698