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

Unified Diff: src/core/SkColorFilterShader.h

Issue 1562193002: add SkShader::newWithColorFilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak formatting Created 4 years, 11 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/SkBlitter.cpp ('k') | src/core/SkColorFilterShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorFilterShader.h
diff --git a/src/core/SkFilterShader.h b/src/core/SkColorFilterShader.h
similarity index 51%
rename from src/core/SkFilterShader.h
rename to src/core/SkColorFilterShader.h
index ea5eaed34fe59428574bdd746df474f444e12e6c..e92908ee83dd421649f9ca28ae547216e31496c9 100644
--- a/src/core/SkFilterShader.h
+++ b/src/core/SkColorFilterShader.h
@@ -1,57 +1,62 @@
/*
- * Copyright 2012 Google Inc.
+ * Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#ifndef SkFilterShader_DEFINED
-#define SkFilterShader_DEFINED
+#ifndef SkColorFilterShader_DEFINED
+#define SkColorFilterShader_DEFINED
+#include "SkColorFilter.h"
#include "SkShader.h"
-class SkColorFilter;
-
-class SkFilterShader : public SkShader {
+class SkColorFilterShader : public SkShader {
public:
- SkFilterShader(SkShader* shader, SkColorFilter* filter);
- virtual ~SkFilterShader();
-
+ SkColorFilterShader(SkShader* shader, SkColorFilter* filter);
+
size_t contextSize() const override;
+
+#if SK_SUPPORT_GPU
+ const GrFragmentProcessor* asFragmentProcessor(GrContext*,
+ const SkMatrix& viewM,
+ const SkMatrix* localMatrix,
+ SkFilterQuality) const override;
+#endif
class FilterShaderContext : public SkShader::Context {
public:
// Takes ownership of shaderContext and calls its destructor.
- FilterShaderContext(const SkFilterShader&, SkShader::Context*, const ContextRec&);
+ FilterShaderContext(const SkColorFilterShader&, SkShader::Context*, const ContextRec&);
virtual ~FilterShaderContext();
-
+
uint32_t getFlags() const override;
-
+
void shadeSpan(int x, int y, SkPMColor[], int count) override;
-
+
void set3DMask(const SkMask* mask) override {
// forward to our proxy
fShaderContext->set3DMask(mask);
}
-
+
private:
SkShader::Context* fShaderContext;
-
+
typedef SkShader::Context INHERITED;
};
-
+
SK_TO_STRING_OVERRIDE()
- SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkFilterShader)
-
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterShader)
+
protected:
void flatten(SkWriteBuffer&) const override;
Context* onCreateContext(const ContextRec&, void* storage) const override;
-
-
+
+
private:
- SkShader* fShader;
- SkColorFilter* fFilter;
-
+ SkAutoTUnref<SkShader> fShader;
+ SkAutoTUnref<SkColorFilter> fFilter;
+
typedef SkShader INHERITED;
};
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkColorFilterShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698