aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-07-22 11:05:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-22 11:05:04 -0700
commit9a5c47f4effba3b48a9a8c7c144b72b532d06efe (patch)
tree6eadf3e08008767aeb0620ed8bbabe75490d7698 /include
parent839345d63466a4209a0985654ec033624821fd78 (diff)
Add SkRasterPipeline blitter.
This is now pixel-exact with the existing sRGB SW impl as far as I've tested. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146413002 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot Committed: https://skia.googlesource.com/skia/+/3011e337693a9786f62d8de9ac4b239ad6dbdaca Review-Url: https://codereview.chromium.org/2146413002
Diffstat (limited to 'include')
-rw-r--r--include/core/SkColorFilter.h5
-rw-r--r--include/core/SkXfermode.h10
2 files changed, 12 insertions, 3 deletions
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index 7b2ee7845e..609550f676 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -16,6 +16,7 @@
class GrContext;
class GrFragmentProcessor;
class SkBitmap;
+class SkRasterPipeline;
/**
* ColorFilters are optional objects in the drawing pipeline. When present in
@@ -70,6 +71,8 @@ public:
virtual void filterSpan4f(const SkPM4f src[], int count, SkPM4f result[]) const;
+ bool appendStages(SkRasterPipeline*) const;
+
enum Flags {
/** If set the filter methods will not change the alpha channel of the colors.
*/
@@ -168,6 +171,8 @@ public:
protected:
SkColorFilter() {}
+ virtual bool onAppendStages(SkRasterPipeline*) const;
+
private:
/*
* Returns 1 if this is a single filter (not a composition of other filters), otherwise it
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 6215315576..2d12b3c931 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -14,6 +14,7 @@
class GrFragmentProcessor;
class GrTexture;
class GrXPFactory;
+class SkRasterPipeline;
class SkString;
struct SkPM4f;
@@ -164,6 +165,8 @@ public:
virtual SkXfermodeProc4f getProc4f() const;
+ bool appendStages(SkRasterPipeline*) const;
+
/**
* If the specified mode can be represented by a pair of Coeff, then return
* true and set (if not NULL) the corresponding coeffs. If the mode is
@@ -216,15 +219,15 @@ public:
#if SK_SUPPORT_GPU
/** Used by the SkXfermodeImageFilter to blend two colors via a GrFragmentProcessor.
The input to the returned FP is the src color. The dst color is
- provided by the dst param which becomes a child FP of the returned FP.
+ provided by the dst param which becomes a child FP of the returned FP.
It is legal for the function to return a null output. This indicates that
the output of the blend is simply the src color.
*/
virtual sk_sp<GrFragmentProcessor> makeFragmentProcessorForImageFilter(
sk_sp<GrFragmentProcessor> dst) const;
- /** A subclass must implement this factory function to work with the GPU backend.
- The xfermode will return a factory for which the caller will get a ref. It is up
+ /** A subclass must implement this factory function to work with the GPU backend.
+ The xfermode will return a factory for which the caller will get a ref. It is up
to the caller to install it. XferProcessors cannot use a background texture.
*/
virtual sk_sp<GrXPFactory> asXPFactory() const;
@@ -281,6 +284,7 @@ protected:
virtual D32Proc onGetD32Proc(uint32_t flags) const;
virtual F16Proc onGetF16Proc(uint32_t flags) const;
+ virtual bool onAppendStages(SkRasterPipeline*) const;
private:
enum {