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

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

Issue 648863002: Devirtualize read/write pixels on surface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify return Created 6 years, 2 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/GrContext.cpp ('k') | src/gpu/GrRenderTarget.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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 desc.fFlags = kDynamicUpdate_GrTextureFlagBit; 183 desc.fFlags = kDynamicUpdate_GrTextureFlagBit;
184 desc.fWidth = width; 184 desc.fWidth = width;
185 desc.fHeight = height; 185 desc.fHeight = height;
186 desc.fConfig = kAlpha_8_GrPixelConfig; 186 desc.fConfig = kAlpha_8_GrPixelConfig;
187 187
188 *gammaTexture = context->getGpu()->createTexture(desc, NULL, 0); 188 *gammaTexture = context->getGpu()->createTexture(desc, NULL, 0);
189 if (NULL == *gammaTexture) { 189 if (NULL == *gammaTexture) {
190 return; 190 return;
191 } 191 }
192 192
193 context->writeTexturePixels(*gammaTexture, 193 (*gammaTexture)->writePixels(0, 0, width, height,
194 0, 0, width, height, 194 (*gammaTexture)->config(), data.get(), 0,
195 (*gammaTexture)->config(), data.get(), 0, 195 GrContext::kDontFlush_PixelOpsFlag);
196 GrContext::kDontFlush_PixelOpsFlag);
197 } 196 }
198 } 197 }
199 198
200 void GrDistanceFieldTextContext::drawText(const GrPaint& paint, const SkPaint& s kPaint, 199 void GrDistanceFieldTextContext::drawText(const GrPaint& paint, const SkPaint& s kPaint,
201 const char text[], size_t byteLength, 200 const char text[], size_t byteLength,
202 SkScalar x, SkScalar y) { 201 SkScalar x, SkScalar y) {
203 SkASSERT(byteLength == 0 || text != NULL); 202 SkASSERT(byteLength == 0 || text != NULL);
204 203
205 // nothing to draw or can't draw 204 // nothing to draw or can't draw
206 if (text == NULL || byteLength == 0 /* no raster clip? || fRC->isEmpty()*/ 205 if (text == NULL || byteLength == 0 /* no raster clip? || fRC->isEmpty()*/
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 fVertexBounds.setLargestInverted(); 667 fVertexBounds.setLargestInverted();
669 } 668 }
670 } 669 }
671 670
672 inline void GrDistanceFieldTextContext::finish() { 671 inline void GrDistanceFieldTextContext::finish() {
673 this->flush(); 672 this->flush();
674 673
675 GrTextContext::finish(); 674 GrTextContext::finish();
676 } 675 }
677 676
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698