OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrTextureStripAtlas.h" | 8 #include "GrTextureStripAtlas.h" |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 row->fLocks = 1; | 151 row->fLocks = 1; |
152 fKeyTable.insert(index, 1, &row); | 152 fKeyTable.insert(index, 1, &row); |
153 rowNumber = static_cast<int>(row - fRows); | 153 rowNumber = static_cast<int>(row - fRows); |
154 | 154 |
155 SkAutoLockPixels lock(data); | 155 SkAutoLockPixels lock(data); |
156 | 156 |
157 // Pass in the kDontFlush flag, since we know we're writing to a part of
this texture | 157 // Pass in the kDontFlush flag, since we know we're writing to a part of
this texture |
158 // that is not currently in use | 158 // that is not currently in use |
159 fTexture->writePixels(0, rowNumber * fDesc.fRowHeight, | 159 fTexture->writePixels(0, rowNumber * fDesc.fRowHeight, |
160 fDesc.fWidth, fDesc.fRowHeight, | 160 fDesc.fWidth, fDesc.fRowHeight, |
161 SkImageInfo2GrPixelConfig(data.info()), | 161 SkImageInfo2GrPixelConfig(data.info(), *this->getC
ontext()->caps()), |
162 data.getPixels(), | 162 data.getPixels(), |
163 data.rowBytes(), | 163 data.rowBytes(), |
164 GrContext::kDontFlush_PixelOpsFlag); | 164 GrContext::kDontFlush_PixelOpsFlag); |
165 } | 165 } |
166 | 166 |
167 SkASSERT(rowNumber >= 0); | 167 SkASSERT(rowNumber >= 0); |
168 VALIDATE; | 168 VALIDATE; |
169 return rowNumber; | 169 return rowNumber; |
170 } | 170 } |
171 | 171 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 343 |
344 // If we have locked rows, we should have a locked texture, otherwise | 344 // If we have locked rows, we should have a locked texture, otherwise |
345 // it should be unlocked | 345 // it should be unlocked |
346 if (fLockedRows == 0) { | 346 if (fLockedRows == 0) { |
347 SkASSERT(nullptr == fTexture); | 347 SkASSERT(nullptr == fTexture); |
348 } else { | 348 } else { |
349 SkASSERT(fTexture); | 349 SkASSERT(fTexture); |
350 } | 350 } |
351 } | 351 } |
352 #endif | 352 #endif |
OLD | NEW |