OLD | NEW |
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 "GrCaps.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 sampleCnt = 0; | 109 sampleCnt = 0; |
110 } | 110 } |
111 | 111 |
112 // We actually only need A8, but it often isn't supported as a | 112 // We actually only need A8, but it often isn't supported as a |
113 // render target so default to RGBA_8888 | 113 // render target so default to RGBA_8888 |
114 GrPixelConfig config = kRGBA_8888_GrPixelConfig; | 114 GrPixelConfig config = kRGBA_8888_GrPixelConfig; |
115 if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, sampleCnt >
0)) { | 115 if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, sampleCnt >
0)) { |
116 config = kAlpha_8_GrPixelConfig; | 116 config = kAlpha_8_GrPixelConfig; |
117 } | 117 } |
118 | 118 |
119 sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_B
ackingFit, | 119 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr
ox, |
120 SkScalarCeilToInt(m
askRect->width()), | 120 SkScalarCeilToInt(m
askRect->width()), |
121 SkScalarCeilToInt(m
askRect->height()), | 121 SkScalarCeilToInt(m
askRect->height()), |
122 config, | 122 config, |
123 sampleCnt)); | 123 sampleCnt)); |
124 if (!drawContext) { | 124 if (!drawContext) { |
125 return nullptr; | 125 return nullptr; |
126 } | 126 } |
127 | 127 |
128 drawContext->clear(nullptr, 0x0, true); | 128 drawContext->clear(nullptr, 0x0, true); |
129 | 129 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } | 338 } |
339 | 339 |
340 if (paint.getMaskFilter()) { | 340 if (paint.getMaskFilter()) { |
341 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, | 341 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, |
342 paint.getMaskFilter(), pathEffect, strokeInfo
, | 342 paint.getMaskFilter(), pathEffect, strokeInfo
, |
343 pathPtr, pathIsMutable); | 343 pathPtr, pathIsMutable); |
344 } else { | 344 } else { |
345 drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); | 345 drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); |
346 } | 346 } |
347 } | 347 } |
OLD | NEW |