Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: src/gpu/vk/GrVkGpu.cpp

Issue 1760343003: Revert of Don't allow nullptr in texels array params (unless using a transfer buffer). (Closed) Base URL: https://skia.googlesource.com/skia@usesdk
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698