Title: [244297] trunk/Source/WebCore
Revision
244297
Author
justin_...@apple.com
Date
2019-04-15 14:58:14 -0700 (Mon, 15 Apr 2019)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (244296 => 244297)


--- trunk/Source/WebCore/ChangeLog	2019-04-15 21:58:08 UTC (rev 244296)
+++ trunk/Source/WebCore/ChangeLog	2019-04-15 21:58:14 UTC (rev 244297)
@@ -1,3 +1,17 @@
+2019-04-15  Justin Fan  <justin_...@apple.com>
+
+        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):
+
 2019-04-12  Ryosuke Niwa  <rn...@webkit.org>
 
         Throw TypeError when custom element constructor returns a wrong element or tries to create itself

Modified: trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm (244296 => 244297)


--- trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm	2019-04-15 21:58:08 UTC (rev 244296)
+++ trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUBufferMetal.mm	2019-04-15 21:58:14 UTC (rev 244297)
@@ -66,7 +66,7 @@
 {
     // MTLBuffer size (NSUInteger) is 32 bits on some platforms.
     NSUInteger size = 0;
-    if (!WTF::convertSafely<NSUInteger, uint64_t>(descriptor.size, size)) {
+    if (!WTF::convertSafely(descriptor.size, size)) {
         LOG(WebGPU, "GPUBuffer::tryCreate(): Buffer size is too large!");
         return nullptr;
     }

Modified: trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm (244296 => 244297)


--- trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm	2019-04-15 21:58:08 UTC (rev 244296)
+++ trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm	2019-04-15 21:58:14 UTC (rev 244297)
@@ -141,7 +141,7 @@
 
     // MTLBuffer size (NSUInteger) is 32 bits on some platforms.
     NSUInteger sourceOffset = 0;
-    if (!WTF::convertSafely<NSUInteger, uint64_t>(srcBuffer.offset, sourceOffset)) {
+    if (!WTF::convertSafely(srcBuffer.offset, sourceOffset)) {
         LOG(WebGPU, "GPUCommandBuffer::copyBufferToTexture(): Source offset is too large!");
         return;
     }
@@ -185,7 +185,7 @@
     }
     // MTLBuffer size (NSUInteger) is 32 bits on some platforms.
     NSUInteger destinationOffset = 0;
-    if (!WTF::convertSafely<NSUInteger, uint64_t>(dstBuffer.offset, destinationOffset)) {
+    if (!WTF::convertSafely(dstBuffer.offset, destinationOffset)) {
         LOG(WebGPU, "GPUCommandBuffer::copyTextureToBuffer(): Destination offset is too large!");
         return;
     }

Modified: trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm (244296 => 244297)


--- trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm	2019-04-15 21:58:08 UTC (rev 244296)
+++ trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm	2019-04-15 21:58:14 UTC (rev 244297)
@@ -343,7 +343,7 @@
         // MTLBuffer size (NSUInteger) is 32 bits on some platforms.
         // FIXME: Ensure offset < buffer's stride + format's data size.
         NSUInteger attributeOffset = 0;
-        if (!WTF::convertSafely<NSUInteger, uint64_t>(attributes[i].offset, attributeOffset)) {
+        if (!WTF::convertSafely(attributes[i].offset, attributeOffset)) {
             LOG(WebGPU, "%s: Buffer offset for vertex attribute %u is too large!", functionName, location);
             return false;
         }
@@ -365,7 +365,7 @@
             return false;
         }
         NSUInteger inputStride = 0;
-        if (!WTF::convertSafely<NSUInteger, uint64_t>(inputs[j].stride, inputStride)) {
+        if (!WTF::convertSafely(inputs[j].stride, inputStride)) {
             LOG(WebGPU, "%s: Stride for vertex buffer slot %d is too large!", functionName, slot);
             return false;
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to