OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrVkGpu.h" | 8 #include "GrVkGpu.h" |
9 | 9 |
10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 #endif | 535 #endif |
536 } else { | 536 } else { |
537 tex = GrVkTexture::CreateNewTexture(this, desc, lifeCycle, imageDesc); | 537 tex = GrVkTexture::CreateNewTexture(this, desc, lifeCycle, imageDesc); |
538 } | 538 } |
539 | 539 |
540 if (!tex) { | 540 if (!tex) { |
541 return nullptr; | 541 return nullptr; |
542 } | 542 } |
543 | 543 |
544 // TODO: We're ignoring MIP levels here. | 544 // TODO: We're ignoring MIP levels here. |
545 if (!texels.empty() && texels.begin()->fPixels) { | 545 if (!texels.empty()) { |
| 546 SkASSERT(texels.begin()->fPixels); |
546 if (!this->uploadTexData(tex, 0, 0, desc.fWidth, desc.fHeight, desc.fCon
fig, | 547 if (!this->uploadTexData(tex, 0, 0, desc.fWidth, desc.fHeight, desc.fCon
fig, |
547 texels.begin()->fPixels, texels.begin()->fRowBy
tes)) { | 548 texels.begin()->fPixels, texels.begin()->fRowBy
tes)) { |
548 tex->unref(); | 549 tex->unref(); |
549 return nullptr; | 550 return nullptr; |
550 } | 551 } |
551 } | 552 } |
552 | 553 |
553 return tex; | 554 return tex; |
554 } | 555 } |
555 | 556 |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 int set_a_break_pt_here = 9; | 1420 int set_a_break_pt_here = 9; |
1420 aglSwapBuffers(aglGetCurrentContext()); | 1421 aglSwapBuffers(aglGetCurrentContext()); |
1421 #elif defined(SK_BUILD_FOR_WIN32) | 1422 #elif defined(SK_BUILD_FOR_WIN32) |
1422 SwapBuf(); | 1423 SwapBuf(); |
1423 int set_a_break_pt_here = 9; | 1424 int set_a_break_pt_here = 9; |
1424 SwapBuf(); | 1425 SwapBuf(); |
1425 #endif | 1426 #endif |
1426 #endif | 1427 #endif |
1427 } | 1428 } |
1428 | 1429 |
OLD | NEW |