| 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 SkTextureCompressor_Blitter_DEFINED | 8 #ifndef SkTextureCompressor_Blitter_DEFINED |
| 9 #define SkTextureCompressor_Blitter_DEFINED | 9 #define SkTextureCompressor_Blitter_DEFINED |
| 10 | 10 |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 finalX = 0xFFFFF; | 402 finalX = 0xFFFFF; |
| 403 for (int i = 0; i < BlockDim; ++i) { | 403 for (int i = 0; i < BlockDim; ++i) { |
| 404 finalX = SkMin32(nextX[i], finalX); | 404 finalX = SkMin32(nextX[i], finalX); |
| 405 } | 405 } |
| 406 } | 406 } |
| 407 | 407 |
| 408 // If we didn't land on a block boundary, output the block... | 408 // If we didn't land on a block boundary, output the block... |
| 409 if ((curX % BlockDim) > 1) { | 409 if ((curX % BlockDim) > 0) { |
| 410 #ifdef SK_DEBUG |
| 411 for (int i = 0; i < BlockDim; ++i) { |
| 412 SkASSERT(nextX[i] == kLongestRun || nextX[i] == curX); |
| 413 } |
| 414 #endif |
| 415 const int col = curX % BlockDim; |
| 416 const int colsLeft = BlockDim - col; |
| 417 |
| 418 memset(curAlphaColumn, 0, sizeof(curAlphaColumn)); |
| 419 this->updateBlockColumns(block, col, colsLeft, curAlphaColumn); |
| 420 |
| 410 CompressorType::CompressA8Vertical(outPtr, reinterpret_cast<uint8_t*
>(block)); | 421 CompressorType::CompressA8Vertical(outPtr, reinterpret_cast<uint8_t*
>(block)); |
| 411 } | 422 } |
| 412 | 423 |
| 413 fNextRun = 0; | 424 fNextRun = 0; |
| 414 } | 425 } |
| 415 }; | 426 }; |
| 416 | 427 |
| 417 } // namespace SkTextureCompressor | 428 } // namespace SkTextureCompressor |
| 418 | 429 |
| 419 #endif // SkTextureCompressor_Blitter_DEFINED | 430 #endif // SkTextureCompressor_Blitter_DEFINED |
| OLD | NEW |