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

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

Issue 2146413002: Add SkRasterPipeline blitter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Do not leak the blitter. Created 4 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 unified diff | Download patch
« no previous file with comments | « include/core/SkXfermode.h ('k') | src/core/SkColorFilter.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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 if (SkXfermode::IsMode(mode, SkXfermode::kClear_Mode)) { 846 if (SkXfermode::IsMode(mode, SkXfermode::kClear_Mode)) {
847 SkPaint* p = paint.writable(); 847 SkPaint* p = paint.writable();
848 p->setShader(nullptr); 848 p->setShader(nullptr);
849 shader = nullptr; 849 shader = nullptr;
850 p->setColorFilter(nullptr); 850 p->setColorFilter(nullptr);
851 cf = nullptr; 851 cf = nullptr;
852 mode = p->setXfermodeMode(SkXfermode::kSrc_Mode); 852 mode = p->setXfermodeMode(SkXfermode::kSrc_Mode);
853 p->setColor(0); 853 p->setColor(0);
854 } 854 }
855 855
856 if (SkBlitter* blitter = SkCreateRasterPipelineBlitter(device, *paint, alloc ator)) {
857 return blitter;
858 }
859
856 if (nullptr == shader) { 860 if (nullptr == shader) {
857 if (mode) { 861 if (mode) {
858 // xfermodes (and filters) require shaders for our current blitters 862 // xfermodes (and filters) require shaders for our current blitters
859 paint.writable()->setShader(SkShader::MakeColorShader(paint->getColo r())); 863 paint.writable()->setShader(SkShader::MakeColorShader(paint->getColo r()));
860 paint.writable()->setAlpha(0xFF); 864 paint.writable()->setAlpha(0xFF);
861 shader = paint->getShader(); 865 shader = paint->getShader();
862 } else if (cf) { 866 } else if (cf) {
863 // if no shader && no xfermode, we just apply the colorfilter to 867 // if no shader && no xfermode, we just apply the colorfilter to
864 // our color and move on. 868 // our color and move on.
865 SkPaint* writablePaint = paint.writable(); 869 SkPaint* writablePaint = paint.writable();
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 fShaderContext->~Context(); 1009 fShaderContext->~Context();
1006 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); 1010 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext);
1007 if (nullptr == ctx) { 1011 if (nullptr == ctx) {
1008 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call 1012 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call
1009 // the in-place destructor. 1013 // the in-place destructor.
1010 new (fShaderContext) SkZeroShaderContext(*fShader, rec); 1014 new (fShaderContext) SkZeroShaderContext(*fShader, rec);
1011 return false; 1015 return false;
1012 } 1016 }
1013 return true; 1017 return true;
1014 } 1018 }
OLDNEW
« no previous file with comments | « include/core/SkXfermode.h ('k') | src/core/SkColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698