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

Side by Side Diff: src/gpu/GrAtlasTextContext.h

Issue 1189223002: Remove gamma field from SkDeviceProperties (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cleanup DistanceAdjustTable 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/core/SkPaint.cpp ('k') | src/gpu/GrAtlasTextContext.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 #ifndef GrAtlasTextContext_DEFINED 8 #ifndef GrAtlasTextContext_DEFINED
9 #define GrAtlasTextContext_DEFINED 9 #define GrAtlasTextContext_DEFINED
10 10
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 const SkPaint&, const SkMatrix& viewMatrix, 359 const SkPaint&, const SkMatrix& viewMatrix,
360 const char text[], size_t byteL ength, 360 const char text[], size_t byteL ength,
361 const SkScalar pos[], int scala rsPerPosition, 361 const SkScalar pos[], int scala rsPerPosition,
362 const SkPoint& offset, 362 const SkPoint& offset,
363 const SkIRect& regionClipBounds ); 363 const SkIRect& regionClipBounds );
364 364
365 // Distance field text needs this table to compute a value for use in the fr agment shader. 365 // Distance field text needs this table to compute a value for use in the fr agment shader.
366 // Because the GrAtlasTextContext can go out of scope before the final flush , this needs to be 366 // Because the GrAtlasTextContext can go out of scope before the final flush , this needs to be
367 // refcnted and malloced 367 // refcnted and malloced
368 struct DistanceAdjustTable : public SkNVRefCnt<DistanceAdjustTable> { 368 struct DistanceAdjustTable : public SkNVRefCnt<DistanceAdjustTable> {
369 DistanceAdjustTable(float gamma) { this->buildDistanceAdjustTable(gamma) ; } 369 DistanceAdjustTable() { this->buildDistanceAdjustTable(); }
370 ~DistanceAdjustTable() { SkDELETE_ARRAY(fTable); } 370 ~DistanceAdjustTable() { SkDELETE_ARRAY(fTable); }
371 371
372 void buildDistanceAdjustTable(float gamma);
373
374 SkScalar& operator[] (int i) {
375 return fTable[i];
376 }
377
378 const SkScalar& operator[] (int i) const { 372 const SkScalar& operator[] (int i) const {
379 return fTable[i]; 373 return fTable[i];
380 } 374 }
381 375
376 private:
377 void buildDistanceAdjustTable();
378
382 SkScalar* fTable; 379 SkScalar* fTable;
383 }; 380 };
384 381
385 GrBatchTextStrike* fCurrStrike; 382 GrBatchTextStrike* fCurrStrike;
386 GrTextBlobCache* fCache; 383 GrTextBlobCache* fCache;
387 SkAutoTUnref<DistanceAdjustTable> fDistanceAdjustTable; 384 SkAutoTUnref<DistanceAdjustTable> fDistanceAdjustTable;
388 385
389 friend class GrTextBlobCache; 386 friend class GrTextBlobCache;
390 friend class BitmapTextBatch; 387 friend class BitmapTextBatch;
391 388
392 #ifdef GR_TEST_UTILS 389 #ifdef GR_TEST_UTILS
393 BATCH_TEST_FRIEND(TextBlobBatch); 390 BATCH_TEST_FRIEND(TextBlobBatch);
394 #endif 391 #endif
395 392
396 typedef GrTextContext INHERITED; 393 typedef GrTextContext INHERITED;
397 }; 394 };
398 395
399 #endif 396 #endif
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698