Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-swiftshader: Commit

external/swiftshader


Commit MetaInfo

Revisiónb8c63935328fde3a5acf68225f3ed5c890396d02 (tree)
Tiempo2019-03-19 20:56:05
AutorNicolas Capens <capn@goog...>
CommiterNicolas Capens

Log Message

Use C++11 std::swap()

Bug b/126126820

Change-Id: Iaf3991d58c64995018ba0d15773b65d463e03fad
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27549
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>

Cambiar Resumen

Diferencia incremental

--- a/src/Device/Blitter.cpp
+++ b/src/Device/Blitter.cpp
@@ -20,6 +20,8 @@
2020 #include "Vulkan/VkDebug.hpp"
2121 #include "Vulkan/VkImage.hpp"
2222
23+#include <utility>
24+
2325 namespace sw
2426 {
2527 Blitter::Blitter()
@@ -1523,14 +1525,14 @@ namespace sw
15231525
15241526 if(region.dstOffsets[0].x > region.dstOffsets[1].x)
15251527 {
1526- swap(region.srcOffsets[0].x, region.srcOffsets[1].x);
1527- swap(region.dstOffsets[0].x, region.dstOffsets[1].x);
1528+ std::swap(region.srcOffsets[0].x, region.srcOffsets[1].x);
1529+ std::swap(region.dstOffsets[0].x, region.dstOffsets[1].x);
15281530 }
15291531
15301532 if(region.dstOffsets[0].y > region.dstOffsets[1].y)
15311533 {
1532- swap(region.srcOffsets[0].y, region.srcOffsets[1].y);
1533- swap(region.dstOffsets[0].y, region.dstOffsets[1].y);
1534+ std::swap(region.srcOffsets[0].y, region.srcOffsets[1].y);
1535+ std::swap(region.dstOffsets[0].y, region.dstOffsets[1].y);
15341536 }
15351537
15361538 VkExtent3D srcExtent = src->getMipLevelExtent(region.srcSubresource.mipLevel);
--- a/src/System/Math.hpp
+++ b/src/System/Math.hpp
@@ -66,14 +66,6 @@ namespace sw
6666 return min(min(a, b), min(c, d));
6767 }
6868
69- template<class T>
70- inline void swap(T &a, T &b)
71- {
72- T t = a;
73- a = b;
74- b = t;
75- }
76-
7769 template <typename destType, typename sourceType>
7870 destType bit_cast(const sourceType &source)
7971 {
Show on old repository browser