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()) { | 545 if (!texels.empty() && texels.begin()->fPixels) { |
546 SkASSERT(texels.begin()->fPixels); | |
547 if (!this->uploadTexData(tex, 0, 0, desc.fWidth, desc.fHeight, desc.fCon
fig, | 546 if (!this->uploadTexData(tex, 0, 0, desc.fWidth, desc.fHeight, desc.fCon
fig, |
548 texels.begin()->fPixels, texels.begin()->fRowBy
tes)) { | 547 texels.begin()->fPixels, texels.begin()->fRowBy
tes)) { |
549 tex->unref(); | 548 tex->unref(); |
550 return nullptr; | 549 return nullptr; |
551 } | 550 } |
552 } | 551 } |
553 | 552 |
554 return tex; | 553 return tex; |
555 } | 554 } |
556 | 555 |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 int set_a_break_pt_here = 9; | 1410 int set_a_break_pt_here = 9; |
1412 aglSwapBuffers(aglGetCurrentContext()); | 1411 aglSwapBuffers(aglGetCurrentContext()); |
1413 #elif defined(SK_BUILD_FOR_WIN32) | 1412 #elif defined(SK_BUILD_FOR_WIN32) |
1414 SwapBuf(); | 1413 SwapBuf(); |
1415 int set_a_break_pt_here = 9; | 1414 int set_a_break_pt_here = 9; |
1416 SwapBuf(); | 1415 SwapBuf(); |
1417 #endif | 1416 #endif |
1418 #endif | 1417 #endif |
1419 } | 1418 } |
1420 | 1419 |
OLD | NEW |