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

Unified Diff: src/core/SkColorMatrixFilterRowMajor255.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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/SkColorMatrixFilterRowMajor255.h ('k') | src/core/SkColorShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorMatrixFilterRowMajor255.cpp
diff --git a/src/core/SkColorMatrixFilterRowMajor255.cpp b/src/core/SkColorMatrixFilterRowMajor255.cpp
index c158a7948fec040847f47d635f155ec988d7a4b0..cdfd1df49604e26e0c2a6b2998465be06ebf6b8b 100644
--- a/src/core/SkColorMatrixFilterRowMajor255.cpp
+++ b/src/core/SkColorMatrixFilterRowMajor255.cpp
@@ -8,11 +8,12 @@
#include "SkColorMatrixFilterRowMajor255.h"
#include "SkColorPriv.h"
#include "SkNx.h"
+#include "SkPM4fPriv.h"
#include "SkReadBuffer.h"
-#include "SkWriteBuffer.h"
-#include "SkUnPreMultiply.h"
+#include "SkRefCnt.h"
#include "SkString.h"
-#include "SkPM4fPriv.h"
+#include "SkUnPreMultiply.h"
+#include "SkWriteBuffer.h"
static void transpose(float dst[20], const float src[20]) {
const float* srcR = src + 0;
@@ -247,8 +248,8 @@ SkColorMatrixFilterRowMajor255::makeComposed(sk_sp<SkColorFilter> innerFilter) c
class ColorMatrixEffect : public GrFragmentProcessor {
public:
- static const GrFragmentProcessor* Create(const SkScalar matrix[20]) {
- return new ColorMatrixEffect(matrix);
+ static sk_sp<GrFragmentProcessor> Make(const SkScalar matrix[20]) {
+ return sk_sp<GrFragmentProcessor>(new ColorMatrixEffect(matrix));
}
const char* name() const override { return "Color Matrix"; }
@@ -387,16 +388,16 @@ private:
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorMatrixEffect);
-const GrFragmentProcessor* ColorMatrixEffect::TestCreate(GrProcessorTestData* d) {
+sk_sp<GrFragmentProcessor> ColorMatrixEffect::TestCreate(GrProcessorTestData* d) {
SkScalar colorMatrix[20];
for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix); ++i) {
colorMatrix[i] = d->fRandom->nextSScalar1();
}
- return ColorMatrixEffect::Create(colorMatrix);
+ return ColorMatrixEffect::Make(colorMatrix);
}
-const GrFragmentProcessor* SkColorMatrixFilterRowMajor255::asFragmentProcessor(GrContext*) const {
- return ColorMatrixEffect::Create(fMatrix);
+sk_sp<GrFragmentProcessor> SkColorMatrixFilterRowMajor255::asFragmentProcessor(GrContext*) const {
+ return ColorMatrixEffect::Make(fMatrix);
}
#endif
« no previous file with comments | « src/core/SkColorMatrixFilterRowMajor255.h ('k') | src/core/SkColorShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698