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

Side by Side Diff: src/gpu/effects/GrTextureStripAtlas.cpp

Issue 655913003: Use texture strip atlas for color table filter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix include order Created 6 years, 1 month 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrTextureStripAtlas.h" 9 #include "GrTextureStripAtlas.h"
10 #include "SkPixelRef.h" 10 #include "SkPixelRef.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 : fCacheKey(sk_atomic_inc(&gCacheCount)) 73 : fCacheKey(sk_atomic_inc(&gCacheCount))
74 , fLockedRows(0) 74 , fLockedRows(0)
75 , fDesc(desc) 75 , fDesc(desc)
76 , fNumRows(desc.fHeight / desc.fRowHeight) 76 , fNumRows(desc.fHeight / desc.fRowHeight)
77 , fTexture(NULL) 77 , fTexture(NULL)
78 , fRows(SkNEW_ARRAY(AtlasRow, fNumRows)) 78 , fRows(SkNEW_ARRAY(AtlasRow, fNumRows))
79 , fLRUFront(NULL) 79 , fLRUFront(NULL)
80 , fLRUBack(NULL) { 80 , fLRUBack(NULL) {
81 SkASSERT(fNumRows * fDesc.fRowHeight == fDesc.fHeight); 81 SkASSERT(fNumRows * fDesc.fRowHeight == fDesc.fHeight);
82 this->initLRU(); 82 this->initLRU();
83 fNormalizedYHeight = SK_Scalar1 / fDesc.fHeight;
83 VALIDATE; 84 VALIDATE;
84 } 85 }
85 86
86 GrTextureStripAtlas::~GrTextureStripAtlas() { 87 GrTextureStripAtlas::~GrTextureStripAtlas() {
87 SkDELETE_ARRAY(fRows); 88 SkDELETE_ARRAY(fRows);
88 } 89 }
89 90
90 int GrTextureStripAtlas::lockRow(const SkBitmap& data) { 91 int GrTextureStripAtlas::lockRow(const SkBitmap& data) {
91 VALIDATE; 92 VALIDATE;
92 if (0 == fLockedRows) { 93 if (0 == fLockedRows) {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 338
338 // If we have locked rows, we should have a locked texture, otherwise 339 // If we have locked rows, we should have a locked texture, otherwise
339 // it should be unlocked 340 // it should be unlocked
340 if (fLockedRows == 0) { 341 if (fLockedRows == 0) {
341 SkASSERT(NULL == fTexture); 342 SkASSERT(NULL == fTexture);
342 } else { 343 } else {
343 SkASSERT(fTexture); 344 SkASSERT(fTexture);
344 } 345 }
345 } 346 }
346 #endif 347 #endif
OLDNEW
« src/effects/SkTableColorFilter.cpp ('K') | « src/gpu/effects/GrTextureStripAtlas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698