⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 244297 in webkit


Ignore:
Timestamp:
Apr 15, 2019, 2:58:14 PM (7 years ago)
Author:
Justin Fan
Message:

Let WTF::convertSafely deduce types from arguments.

Reviewer's (Darin Adler) follow-up to https://bugs.webkit.org/show_bug.cgi?id=196793.

  • platform/graphics/gpu/cocoa/GPUBufferMetal.mm:

(WebCore::GPUBuffer::tryCreate):

  • platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:

(WebCore::GPUCommandBuffer::copyBufferToTexture):
(WebCore::GPUCommandBuffer::copyTextureToBuffer):

  • platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:

(WebCore::trySetInputStateForPipelineDescriptor):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244293 r244297  
     12019-04-15  Justin Fan  <justin_fan@apple.com>
     2
     3        Let WTF::convertSafely deduce types from arguments.
     4
     5        Reviewer's (Darin Adler) follow-up to https://bugs.webkit.org/show_bug.cgi?id=196793.
     6
     7        * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
     8        (WebCore::GPUBuffer::tryCreate):
     9        * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
     10        (WebCore::GPUCommandBuffer::copyBufferToTexture):
     11        (WebCore::GPUCommandBuffer::copyTextureToBuffer):
     12        * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
     13        (WebCore::trySetInputStateForPipelineDescriptor):
     14
    1152019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm

    r244235 r244297  
    6767    // MTLBuffer size (NSUInteger) is 32 bits on some platforms.
    6868    NSUInteger size = 0;
    69     if (!WTF::convertSafely<NSUInteger, uint64_t>(descriptor.size, size)) {
     69    if (!WTF::convertSafely(descriptor.size, size)) {
    7070        LOG(WebGPU, "GPUBuffer::tryCreate(): Buffer size is too large!");
    7171        return nullptr;
  • trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm

    r244235 r244297  
    142142    // MTLBuffer size (NSUInteger) is 32 bits on some platforms.
    143143    NSUInteger sourceOffset = 0;
    144     if (!WTF::convertSafely<NSUInteger, uint64_t>(srcBuffer.offset, sourceOffset)) {
     144    if (!WTF::convertSafely(srcBuffer.offset, sourceOffset)) {
    145145        LOG(WebGPU, "GPUCommandBuffer::copyBufferToTexture(): Source offset is too large!");
    146146        return;
     
    186186    // MTLBuffer size (NSUInteger) is 32 bits on some platforms.
    187187    NSUInteger destinationOffset = 0;
    188     if (!WTF::convertSafely<NSUInteger, uint64_t>(dstBuffer.offset, destinationOffset)) {
     188    if (!WTF::convertSafely(dstBuffer.offset, destinationOffset)) {
    189189        LOG(WebGPU, "GPUCommandBuffer::copyTextureToBuffer(): Destination offset is too large!");
    190190        return;
  • trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm

    r244235 r244297  
    344344        // FIXME: Ensure offset < buffer's stride + format's data size.
    345345        NSUInteger attributeOffset = 0;
    346         if (!WTF::convertSafely<NSUInteger, uint64_t>(attributes[i].offset, attributeOffset)) {
     346        if (!WTF::convertSafely(attributes[i].offset, attributeOffset)) {
    347347            LOG(WebGPU, "%s: Buffer offset for vertex attribute %u is too large!", functionName, location);
    348348            return false;
     
    366366        }
    367367        NSUInteger inputStride = 0;
    368         if (!WTF::convertSafely<NSUInteger, uint64_t>(inputs[j].stride, inputStride)) {
     368        if (!WTF::convertSafely(inputs[j].stride, inputStride)) {
    369369            LOG(WebGPU, "%s: Stride for vertex buffer slot %d is too large!", functionName, slot);
    370370            return false;
Note: See TracChangeset for help on using the changeset viewer.