| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrLayerCache_DEFINED | 8 #ifndef GrLayerCache_DEFINED |
| 9 #define GrLayerCache_DEFINED | 9 #define GrLayerCache_DEFINED |
| 10 | 10 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 , fPaint(paint ? SkNEW_ARGS(SkPaint, (*paint)) : NULL) | 157 , fPaint(paint ? SkNEW_ARGS(SkPaint, (*paint)) : NULL) |
| 158 , fFilter(NULL) | 158 , fFilter(NULL) |
| 159 , fTexture(NULL) | 159 , fTexture(NULL) |
| 160 , fRect(SkIRect::MakeEmpty()) | 160 , fRect(SkIRect::MakeEmpty()) |
| 161 , fPlot(NULL) | 161 , fPlot(NULL) |
| 162 , fUses(0) | 162 , fUses(0) |
| 163 , fLocked(false) { | 163 , fLocked(false) { |
| 164 SkASSERT(SK_InvalidGenID != pictureID); | 164 SkASSERT(SK_InvalidGenID != pictureID); |
| 165 | 165 |
| 166 if (fPaint) { | 166 if (fPaint) { |
| 167 if (fPaint->getImageFilter()) { | 167 if (fPaint->getImageFilter() && fPaint->getImageFilter()->canFilterI
mageGPU()) { |
| 168 fFilter = SkSafeRef(fPaint->getImageFilter()); | 168 fFilter = SkSafeRef(fPaint->getImageFilter()); |
| 169 fPaint->setImageFilter(NULL); | 169 fPaint->setImageFilter(NULL); |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 ~GrCachedLayer() { | 174 ~GrCachedLayer() { |
| 175 SkSafeUnref(fTexture); | 175 SkSafeUnref(fTexture); |
| 176 SkSafeUnref(fFilter); | 176 SkSafeUnref(fFilter); |
| 177 SkDELETE(fPaint); | 177 SkDELETE(fPaint); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 SkASSERT(fPlotLocks[plotIdx] > 0); | 395 SkASSERT(fPlotLocks[plotIdx] > 0); |
| 396 --fPlotLocks[plotIdx]; | 396 --fPlotLocks[plotIdx]; |
| 397 } | 397 } |
| 398 | 398 |
| 399 // for testing | 399 // for testing |
| 400 friend class TestingAccess; | 400 friend class TestingAccess; |
| 401 int numLayers() const { return fLayerHash.count(); } | 401 int numLayers() const { return fLayerHash.count(); } |
| 402 }; | 402 }; |
| 403 | 403 |
| 404 #endif | 404 #endif |
| OLD | NEW |