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

Side by Side Diff: src/gpu/GrAtlasTextContext.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/GrAddPathRenderers_default.cpp ('k') | src/gpu/GrBlurUtils.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 #include "GrAtlasTextContext.h" 7 #include "GrAtlasTextContext.h"
8 8
9 #include "GrBatch.h" 9 #include "GrBatch.h"
10 #include "GrBatchFontCache.h" 10 #include "GrBatchFontCache.h"
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } 453 }
454 454
455 if (!fEnableDFRendering && !skPaint.isDistanceFieldTextTEMP() && 455 if (!fEnableDFRendering && !skPaint.isDistanceFieldTextTEMP() &&
456 scaledTextSize < kLargeDFFontSize) { 456 scaledTextSize < kLargeDFFontSize) {
457 return false; 457 return false;
458 } 458 }
459 459
460 // rasterizers and mask filters modify alpha, which doesn't 460 // rasterizers and mask filters modify alpha, which doesn't
461 // translate well to distance 461 // translate well to distance
462 if (skPaint.getRasterizer() || skPaint.getMaskFilter() || 462 if (skPaint.getRasterizer() || skPaint.getMaskFilter() ||
463 !fContext->shaderDerivativeSupport()) { 463 !fContext->caps()->shaderCaps()->shaderDerivativeSupport()) {
464 return false; 464 return false;
465 } 465 }
466 466
467 // TODO: add some stroking support 467 // TODO: add some stroking support
468 if (skPaint.getStyle() != SkPaint::kFill_Style) { 468 if (skPaint.getStyle() != SkPaint::kFill_Style) {
469 return false; 469 return false;
470 } 470 }
471 471
472 return true; 472 return true;
473 } 473 }
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after
2285 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text, 2285 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text,
2286 static_cast<size_t>(textLen), 0, 0, noClip)); 2286 static_cast<size_t>(textLen), 0, 0, noClip));
2287 2287
2288 SkScalar transX = static_cast<SkScalar>(random->nextU()); 2288 SkScalar transX = static_cast<SkScalar>(random->nextU());
2289 SkScalar transY = static_cast<SkScalar>(random->nextU()); 2289 SkScalar transY = static_cast<SkScalar>(random->nextU());
2290 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun s[0].fSubRunInfo[0]; 2290 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun s[0].fSubRunInfo[0];
2291 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint); 2291 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint);
2292 } 2292 }
2293 2293
2294 #endif 2294 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAddPathRenderers_default.cpp ('k') | src/gpu/GrBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698