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

Side by Side Diff: src/gpu/GrBlurUtils.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/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrClipMaskManager.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 "GrBlurUtils.h" 8 #include "GrBlurUtils.h"
9 #include "GrDrawContext.h" 9 #include "GrDrawContext.h"
10 #include "GrCaps.h"
10 #include "GrContext.h" 11 #include "GrContext.h"
11 #include "effects/GrSimpleTextureEffect.h" 12 #include "effects/GrSimpleTextureEffect.h"
12 #include "GrStrokeInfo.h" 13 #include "GrStrokeInfo.h"
13 #include "GrTexture.h" 14 #include "GrTexture.h"
14 #include "GrTextureProvider.h" 15 #include "GrTextureProvider.h"
15 #include "SkDraw.h" 16 #include "SkDraw.h"
16 #include "SkGr.h" 17 #include "SkGr.h"
17 #include "SkMaskFilter.h" 18 #include "SkMaskFilter.h"
18 #include "SkPaint.h" 19 #include "SkPaint.h"
19 20
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 int sampleCnt) { 104 int sampleCnt) {
104 GrSurfaceDesc desc; 105 GrSurfaceDesc desc;
105 desc.fFlags = kRenderTarget_GrSurfaceFlag; 106 desc.fFlags = kRenderTarget_GrSurfaceFlag;
106 desc.fWidth = SkScalarCeilToInt(maskRect.width()); 107 desc.fWidth = SkScalarCeilToInt(maskRect.width());
107 desc.fHeight = SkScalarCeilToInt(maskRect.height()); 108 desc.fHeight = SkScalarCeilToInt(maskRect.height());
108 desc.fSampleCnt = doAA ? sampleCnt : 0; 109 desc.fSampleCnt = doAA ? sampleCnt : 0;
109 // We actually only need A8, but it often isn't supported as a 110 // We actually only need A8, but it often isn't supported as a
110 // render target so default to RGBA_8888 111 // render target so default to RGBA_8888
111 desc.fConfig = kRGBA_8888_GrPixelConfig; 112 desc.fConfig = kRGBA_8888_GrPixelConfig;
112 113
113 if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, desc.fSampleCnt > 0) ) { 114 if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, desc.fSample Cnt > 0)) {
114 desc.fConfig = kAlpha_8_GrPixelConfig; 115 desc.fConfig = kAlpha_8_GrPixelConfig;
115 } 116 }
116 117
117 GrTexture* mask = context->textureProvider()->refScratchTexture( 118 GrTexture* mask = context->textureProvider()->refScratchTexture(
118 desc, GrTextureProvider::kApprox_ScratchTexMatch); 119 desc, GrTextureProvider::kApprox_ScratchTexMatch);
119 if (NULL == mask) { 120 if (NULL == mask) {
120 return NULL; 121 return NULL;
121 } 122 }
122 123
123 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); 124 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height());
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 SkPaint::kFill_Sty le; 287 SkPaint::kFill_Sty le;
287 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar get, 288 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar get,
288 clip, viewMatrix, *devPathPtr, 289 clip, viewMatrix, *devPathPtr,
289 paint.getMaskFilter(), clipBounds, &grPaint, style ); 290 paint.getMaskFilter(), clipBounds, &grPaint, style );
290 return; 291 return;
291 } 292 }
292 293
293 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str okeInfo); 294 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str okeInfo);
294 } 295 }
295 296
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698