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

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

Issue 1781013002: Fixes for 32bit win Vulkan build (Closed) Base URL: https://skia.googlesource.com/skia.git@master
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 | « gyp/gpu.gyp ('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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 for (int y = 0; y < height; y++) { 375 for (int y = 0; y < height; y++) {
376 memcpy(dstRow, srcRow, trimRowBytes); 376 memcpy(dstRow, srcRow, trimRowBytes);
377 srcRow += rowBytes; 377 srcRow += rowBytes;
378 dstRow -= layout.rowPitch; 378 dstRow -= layout.rowPitch;
379 } 379 }
380 } else { 380 } else {
381 // If there is no padding on the src (rowBytes) or dst (layout.rowPi tch) we can memcpy 381 // If there is no padding on the src (rowBytes) or dst (layout.rowPi tch) we can memcpy
382 if (trimRowBytes == rowBytes && trimRowBytes == layout.rowPitch) { 382 if (trimRowBytes == rowBytes && trimRowBytes == layout.rowPitch) {
383 memcpy(mapPtr, data, trimRowBytes * height); 383 memcpy(mapPtr, data, trimRowBytes * height);
384 } else { 384 } else {
385 SkRectMemcpy(mapPtr, layout.rowPitch, data, rowBytes, trimRowByt es, height); 385 SkRectMemcpy(mapPtr, static_cast<size_t>(layout.rowPitch), data, rowBytes,
386 trimRowBytes, height);
386 } 387 }
387 } 388 }
388 389
389 GR_VK_CALL(interface, UnmapMemory(fDevice, tex->textureMemory())); 390 GR_VK_CALL(interface, UnmapMemory(fDevice, tex->textureMemory()));
390 } else { 391 } else {
391 GrVkTransferBuffer* transferBuffer = 392 GrVkTransferBuffer* transferBuffer =
392 GrVkTransferBuffer::Create(this, trimRowBytes * height, GrVkBuffer:: kCopyRead_Type); 393 GrVkTransferBuffer::Create(this, trimRowBytes * height, GrVkBuffer:: kCopyRead_Type);
393 394
394 void* mapPtr = transferBuffer->map(); 395 void* mapPtr = transferBuffer->map();
395 396
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 return 0; 792 return 0;
792 } 793 }
793 794
794 size_t bpp = GrBytesPerPixel(config); 795 size_t bpp = GrBytesPerPixel(config);
795 size_t rowCopyBytes = bpp * w; 796 size_t rowCopyBytes = bpp * w;
796 // If there is no padding on dst (layout.rowPitch) we can do a singl e memcopy. 797 // If there is no padding on dst (layout.rowPitch) we can do a singl e memcopy.
797 // This assumes the srcData comes in with no padding. 798 // This assumes the srcData comes in with no padding.
798 if (rowCopyBytes == layout.rowPitch) { 799 if (rowCopyBytes == layout.rowPitch) {
799 memcpy(mapPtr, srcData, rowCopyBytes * h); 800 memcpy(mapPtr, srcData, rowCopyBytes * h);
800 } else { 801 } else {
801 SkRectMemcpy(mapPtr, layout.rowPitch, srcData, w, rowCopyBytes, h); 802 SkRectMemcpy(mapPtr, static_cast<size_t>(layout.rowPitch), srcDa ta, w, rowCopyBytes,
803 h);
802 } 804 }
803 GR_VK_CALL(interface, UnmapMemory(fDevice, imageRsrc->fAlloc)); 805 GR_VK_CALL(interface, UnmapMemory(fDevice, imageRsrc->fAlloc));
804 } else { 806 } else {
805 // TODO: Add support for copying to optimal tiling 807 // TODO: Add support for copying to optimal tiling
806 SkASSERT(false); 808 SkASSERT(false);
807 } 809 }
808 } 810 }
809 811
810 return (GrBackendObject)imageRsrc; 812 return (GrBackendObject)imageRsrc;
811 } 813 }
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 int set_a_break_pt_here = 9; 1410 int set_a_break_pt_here = 9;
1409 aglSwapBuffers(aglGetCurrentContext()); 1411 aglSwapBuffers(aglGetCurrentContext());
1410 #elif defined(SK_BUILD_FOR_WIN32) 1412 #elif defined(SK_BUILD_FOR_WIN32)
1411 SwapBuf(); 1413 SwapBuf();
1412 int set_a_break_pt_here = 9; 1414 int set_a_break_pt_here = 9;
1413 SwapBuf(); 1415 SwapBuf();
1414 #endif 1416 #endif
1415 #endif 1417 #endif
1416 } 1418 }
1417 1419
OLDNEW
« no previous file with comments | « gyp/gpu.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698