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

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

Issue 580863004: Adding 3D lut color filter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: As color filter instead of image filter 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 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 9
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // render target but not vice versa. So we ref the texture to keep both aliv e for 112 // render target but not vice versa. So we ref the texture to keep both aliv e for
113 // the lifetime of this pixel ref. 113 // the lifetime of this pixel ref.
114 fSurface = SkSafeRef(surface->asTexture()); 114 fSurface = SkSafeRef(surface->asTexture());
115 if (NULL == fSurface) { 115 if (NULL == fSurface) {
116 fSurface = SkSafeRef(surface); 116 fSurface = SkSafeRef(surface);
117 } 117 }
118 fUnlock = transferCacheLock; 118 fUnlock = transferCacheLock;
119 119
120 if (fSurface) { 120 if (fSurface) {
121 SkASSERT(info.width() <= fSurface->width()); 121 SkASSERT(info.width() <= fSurface->width());
122 SkASSERT(info.height() <= fSurface->height()); 122 SkASSERT(info.height() <= (fSurface->height() * SkMax32(fSurface->desc() .fDepth, 1)));
123 } 123 }
124 } 124 }
125 125
126 SkGrPixelRef::~SkGrPixelRef() { 126 SkGrPixelRef::~SkGrPixelRef() {
127 if (fUnlock) { 127 if (fUnlock) {
128 GrContext* context = fSurface->getContext(); 128 GrContext* context = fSurface->getContext();
129 GrTexture* texture = fSurface->asTexture(); 129 GrTexture* texture = fSurface->asTexture();
130 if (context && texture) { 130 if (context && texture) {
131 context->unlockScratchTexture(texture); 131 context->unlockScratchTexture(texture);
132 } 132 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 cachedBitmap.setImmutable(); 204 cachedBitmap.setImmutable();
205 //Add to the cache 205 //Add to the cache
206 SkBitmapCache::Add(this->getGenerationID(), bounds, cachedBitmap); 206 SkBitmapCache::Add(this->getGenerationID(), bounds, cachedBitmap);
207 207
208 dst->swap(cachedBitmap); 208 dst->swap(cachedBitmap);
209 } 209 }
210 210
211 return true; 211 return true;
212 212
213 } 213 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698