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

Side by Side Diff: tools/android/SkAndroidSDKCanvas.cpp

Issue 1825073002: Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove flag 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 | « tests/SkColor4fTest.cpp ('k') | tools/debugger/SkDrawCommand.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 2015 Google Inc. 2 * Copyright 2015 Google Inc.
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 "SkAndroidSDKCanvas.h" 8 #include "SkAndroidSDKCanvas.h"
9 9
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // Android SDK only supports mode & matrix color filters 62 // Android SDK only supports mode & matrix color filters
63 // (and, again, no modes above kLighten_Mode). 63 // (and, again, no modes above kLighten_Mode).
64 SkColorFilter* cf = paint->getColorFilter(); 64 SkColorFilter* cf = paint->getColorFilter();
65 if (cf) { 65 if (cf) {
66 SkColor color; 66 SkColor color;
67 SkXfermode::Mode mode; 67 SkXfermode::Mode mode;
68 SkScalar srcColorMatrix[20]; 68 SkScalar srcColorMatrix[20];
69 bool isMode = cf->asColorMode(&color, &mode); 69 bool isMode = cf->asColorMode(&color, &mode);
70 if (isMode && mode > SkXfermode::kLighten_Mode) { 70 if (isMode && mode > SkXfermode::kLighten_Mode) {
71 paint->setColorFilter( 71 paint->setColorFilter(
72 SkColorFilter::CreateModeFilter(color, SkXfermode::kSrcOver_Mode )); 72 SkColorFilter::MakeModeFilter(color, SkXfermode::kSrcOver_Mode)) ;
73 } else if (!isMode && !cf->asColorMatrix(srcColorMatrix)) { 73 } else if (!isMode && !cf->asColorMatrix(srcColorMatrix)) {
74 paint->setColorFilter(nullptr); 74 paint->setColorFilter(nullptr);
75 } 75 }
76 } 76 }
77 77
78 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK 78 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
79 SkPathEffect* pe = paint->getPathEffect(); 79 SkPathEffect* pe = paint->getPathEffect();
80 if (pe && !pe->exposedInAndroidJavaAPI()) { 80 if (pe && !pe->exposedInAndroidJavaAPI()) {
81 paint->setPathEffect(nullptr); 81 paint->setPathEffect(nullptr);
82 } 82 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 fProxyTarget->clipPath(path, op, style); 349 fProxyTarget->clipPath(path, op, style);
350 } 350 }
351 351
352 void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { 352 void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) {
353 fProxyTarget->clipRegion(region, op); 353 fProxyTarget->clipRegion(region, op);
354 } 354 }
355 355
356 void SkAndroidSDKCanvas::onDiscard() { fProxyTarget->discard(); } 356 void SkAndroidSDKCanvas::onDiscard() { fProxyTarget->discard(); }
357 357
358 358
OLDNEW
« no previous file with comments | « tests/SkColor4fTest.cpp ('k') | tools/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698