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

Side by Side Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 269423007: Add CPU backing store for GrAtlas to reduce texture uploads (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add assert to GrPlot::uploadTexture() Created 6 years, 7 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/GrBitmapTextContext.cpp ('k') | src/gpu/GrLayerCache.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 "GrDistanceFieldTextContext.h" 8 #include "GrDistanceFieldTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 void GrDistanceFieldTextContext::flushGlyphs() { 94 void GrDistanceFieldTextContext::flushGlyphs() {
95 if (NULL == fDrawTarget) { 95 if (NULL == fDrawTarget) {
96 return; 96 return;
97 } 97 }
98 98
99 GrDrawState* drawState = fDrawTarget->drawState(); 99 GrDrawState* drawState = fDrawTarget->drawState();
100 GrDrawState::AutoRestoreEffects are(drawState); 100 GrDrawState::AutoRestoreEffects are(drawState);
101 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa rget()); 101 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa rget());
102 102
103 if (fCurrVertex > 0) { 103 if (fCurrVertex > 0) {
104 fContext->getFontCache()->updateTextures();
105
104 // setup our sampler state for our text texture/atlas 106 // setup our sampler state for our text texture/atlas
105 SkASSERT(SkIsAlign4(fCurrVertex)); 107 SkASSERT(SkIsAlign4(fCurrVertex));
106 SkASSERT(fCurrTexture); 108 SkASSERT(fCurrTexture);
107 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil erp_FilterMode); 109 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil erp_FilterMode);
108 110
109 // Effects could be stored with one of the cache objects (atlas?) 111 // Effects could be stored with one of the cache objects (atlas?)
110 if (fUseLCDText) { 112 if (fUseLCDText) {
111 bool useBGR = SkDeviceProperties::Geometry::kBGR_Layout == 113 bool useBGR = SkDeviceProperties::Geometry::kBGR_Layout ==
112 fDeviceProperties.fG eometry.getLayout(); 114 fDeviceProperties.fG eometry.getLayout();
113 drawState->addCoverageEffect(GrDistanceFieldLCDTextureEffect::Create ( 115 drawState->addCoverageEffect(GrDistanceFieldLCDTextureEffect::Create (
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift) 497 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift)
496 + SK_FixedHalf, //d1g.fHalfSampleY, 498 + SK_FixedHalf, //d1g.fHalfSampleY,
497 fontScaler); 499 fontScaler);
498 } 500 }
499 pos += scalarsPerPosition; 501 pos += scalarsPerPosition;
500 } 502 }
501 } 503 }
502 504
503 this->finish(); 505 this->finish();
504 } 506 }
OLDNEW
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrLayerCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698