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

Side by Side Diff: src/effects/SkAlphaThresholdFilter.cpp

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ':' from comment 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 | « src/core/SkSpecialSurface.cpp ('k') | src/effects/SkBlurImageFilter.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 2013 Google Inc. 2 * Copyright 2013 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 "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 const SkIRect& bo unds) const { 97 const SkIRect& bo unds) const {
98 GrPixelConfig config; 98 GrPixelConfig config;
99 if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) { 99 if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) {
100 config = kAlpha_8_GrPixelConfig; 100 config = kAlpha_8_GrPixelConfig;
101 } else { 101 } else {
102 config = kRGBA_8888_GrPixelConfig; 102 config = kRGBA_8888_GrPixelConfig;
103 } 103 }
104 104
105 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr ox, 105 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr ox,
106 bounds.width(), bou nds.height(), 106 bounds.width(), bou nds.height(),
107 config)); 107 config, nullptr));
108 if (!drawContext) { 108 if (!drawContext) {
109 return nullptr; 109 return nullptr;
110 } 110 }
111 111
112 GrPaint grPaint; 112 GrPaint grPaint;
113 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 113 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
114 SkRegion::Iterator iter(fRegion); 114 SkRegion::Iterator iter(fRegion);
115 drawContext->clear(nullptr, 0x0, true); 115 drawContext->clear(nullptr, 0x0, true);
116 116
117 GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height())); 117 GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height()));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 dst); 259 dst);
260 } 260 }
261 261
262 #ifndef SK_IGNORE_TO_STRING 262 #ifndef SK_IGNORE_TO_STRING
263 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { 263 void SkAlphaThresholdFilterImpl::toString(SkString* str) const {
264 str->appendf("SkAlphaThresholdImageFilter: ("); 264 str->appendf("SkAlphaThresholdImageFilter: (");
265 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); 265 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold);
266 str->append(")"); 266 str->append(")");
267 } 267 }
268 #endif 268 #endif
OLDNEW
« no previous file with comments | « src/core/SkSpecialSurface.cpp ('k') | src/effects/SkBlurImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698