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

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

Issue 1149773005: Add direct getter for GrCaps to GrContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init caps in the right place Created 5 years, 6 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/SkPictureShader.cpp ('k') | src/effects/SkGpuBlurUtils.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 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 265
266 #if SK_SUPPORT_GPU 266 #if SK_SUPPORT_GPU
267 bool SkAlphaThresholdFilterImpl::asFragmentProcessor(GrFragmentProcessor** fp, 267 bool SkAlphaThresholdFilterImpl::asFragmentProcessor(GrFragmentProcessor** fp,
268 GrTexture* texture, 268 GrTexture* texture,
269 const SkMatrix& in_matrix, 269 const SkMatrix& in_matrix,
270 const SkIRect&) const { 270 const SkIRect&) const {
271 if (fp) { 271 if (fp) {
272 GrContext* context = texture->getContext(); 272 GrContext* context = texture->getContext();
273 GrSurfaceDesc maskDesc; 273 GrSurfaceDesc maskDesc;
274 if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) { 274 if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) {
275 maskDesc.fConfig = kAlpha_8_GrPixelConfig; 275 maskDesc.fConfig = kAlpha_8_GrPixelConfig;
276 } else { 276 } else {
277 maskDesc.fConfig = kRGBA_8888_GrPixelConfig; 277 maskDesc.fConfig = kRGBA_8888_GrPixelConfig;
278 } 278 }
279 maskDesc.fFlags = kRenderTarget_GrSurfaceFlag; 279 maskDesc.fFlags = kRenderTarget_GrSurfaceFlag;
280 // Add one pixel of border to ensure that clamp mode will be all zeros 280 // Add one pixel of border to ensure that clamp mode will be all zeros
281 // the outside. 281 // the outside.
282 maskDesc.fWidth = texture->width(); 282 maskDesc.fWidth = texture->width();
283 maskDesc.fHeight = texture->height(); 283 maskDesc.fHeight = texture->height();
284 SkAutoTUnref<GrTexture> maskTexture(context->textureProvider()->refScrat chTexture( 284 SkAutoTUnref<GrTexture> maskTexture(context->textureProvider()->refScrat chTexture(
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 381 }
382 382
383 #ifndef SK_IGNORE_TO_STRING 383 #ifndef SK_IGNORE_TO_STRING
384 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { 384 void SkAlphaThresholdFilterImpl::toString(SkString* str) const {
385 str->appendf("SkAlphaThresholdImageFilter: ("); 385 str->appendf("SkAlphaThresholdImageFilter: (");
386 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); 386 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold);
387 str->append(")"); 387 str->append(")");
388 } 388 }
389 #endif 389 #endif
390 390
OLDNEW
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698