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

Side by Side Diff: src/core/SkBlitter.cpp

Issue 1782703002: sk_sp versions of newWithColorFilter and newWithLocalMatrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « samplecode/SamplePatch.cpp ('k') | src/core/SkColorFilterShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBlitter.h" 8 #include "SkBlitter.h"
9 #include "SkAntiRun.h" 9 #include "SkAntiRun.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 // our color and move on. 860 // our color and move on.
861 SkPaint* writablePaint = paint.writable(); 861 SkPaint* writablePaint = paint.writable();
862 writablePaint->setColor(cf->filterColor(paint->getColor())); 862 writablePaint->setColor(cf->filterColor(paint->getColor()));
863 writablePaint->setColorFilter(nullptr); 863 writablePaint->setColorFilter(nullptr);
864 cf = nullptr; 864 cf = nullptr;
865 } 865 }
866 } 866 }
867 867
868 if (cf) { 868 if (cf) {
869 SkASSERT(shader); 869 SkASSERT(shader);
870 shader = shader->newWithColorFilter(cf); 870 paint.writable()->setShader(shader->makeWithColorFilter(cf));
871 paint.writable()->setShader(shader)->unref(); 871 shader = paint->getShader();
872 // blitters should ignore the presence/absence of a filter, since 872 // blitters should ignore the presence/absence of a filter, since
873 // if there is one, the shader will take care of it. 873 // if there is one, the shader will take care of it.
874 } 874 }
875 875
876 /* 876 /*
877 * We create a SkShader::Context object, and store it on the blitter. 877 * We create a SkShader::Context object, and store it on the blitter.
878 */ 878 */
879 SkShader::Context* shaderContext = nullptr; 879 SkShader::Context* shaderContext = nullptr;
880 if (shader) { 880 if (shader) {
881 const SkShader::ContextRec rec(*paint, matrix, nullptr, 881 const SkShader::ContextRec rec(*paint, matrix, nullptr,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 fShaderContext->~Context(); 1002 fShaderContext->~Context();
1003 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); 1003 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext);
1004 if (nullptr == ctx) { 1004 if (nullptr == ctx) {
1005 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call 1005 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call
1006 // the in-place destructor. 1006 // the in-place destructor.
1007 new (fShaderContext) SkZeroShaderContext(*fShader, rec); 1007 new (fShaderContext) SkZeroShaderContext(*fShader, rec);
1008 return false; 1008 return false;
1009 } 1009 }
1010 return true; 1010 return true;
1011 } 1011 }
OLDNEW
« no previous file with comments | « samplecode/SamplePatch.cpp ('k') | src/core/SkColorFilterShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698