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

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

Issue 248033003: Remove support for inheriting the paint color from SkColorShader (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove now unused member var Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBlitter.h" 10 #include "SkBlitter.h"
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 SkPaint* p = paint.writable(); 865 SkPaint* p = paint.writable();
866 shader = p->setShader(NULL); 866 shader = p->setShader(NULL);
867 cf = p->setColorFilter(NULL); 867 cf = p->setColorFilter(NULL);
868 mode = p->setXfermodeMode(SkXfermode::kSrc_Mode); 868 mode = p->setXfermodeMode(SkXfermode::kSrc_Mode);
869 p->setColor(0); 869 p->setColor(0);
870 } 870 }
871 871
872 if (NULL == shader) { 872 if (NULL == shader) {
873 if (mode) { 873 if (mode) {
874 // xfermodes (and filters) require shaders for our current blitters 874 // xfermodes (and filters) require shaders for our current blitters
875 shader = SkNEW(SkColorShader); 875 shader = SkNEW_ARGS(SkColorShader, (paint->getColor()));
876 paint.writable()->setShader(shader)->unref(); 876 paint.writable()->setShader(shader)->unref();
877 paint.writable()->setAlpha(0xFF);
877 } else if (cf) { 878 } else if (cf) {
878 // if no shader && no xfermode, we just apply the colorfilter to 879 // if no shader && no xfermode, we just apply the colorfilter to
879 // our color and move on. 880 // our color and move on.
880 SkPaint* writablePaint = paint.writable(); 881 SkPaint* writablePaint = paint.writable();
881 writablePaint->setColor(cf->filterColor(paint->getColor())); 882 writablePaint->setColor(cf->filterColor(paint->getColor()));
882 writablePaint->setColorFilter(NULL); 883 writablePaint->setColorFilter(NULL);
883 cf = NULL; 884 cf = NULL;
884 } 885 }
885 } 886 }
886 887
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 965
965 fShader->ref(); 966 fShader->ref();
966 fShaderFlags = fShader->getFlags(); 967 fShaderFlags = fShader->getFlags();
967 } 968 }
968 969
969 SkShaderBlitter::~SkShaderBlitter() { 970 SkShaderBlitter::~SkShaderBlitter() {
970 SkASSERT(fShader->setContextHasBeenCalled()); 971 SkASSERT(fShader->setContextHasBeenCalled());
971 fShader->endContext(); 972 fShader->endContext();
972 fShader->unref(); 973 fShader->unref();
973 } 974 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698