[gpu] Switch to std::tuple for FormatType. Now that std::tuple is allowed, there is no need to construct a struct for FormatType. Bug: None Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I8294ff9d3a1e78ca59da95ae9d7c69b9635c0afb Reviewed-on: https://chromium-review.googlesource.com/832367 Commit-Queue: Rijubrata Bhaumik Reviewed-by: Zhenyao Mo Cr-Commit-Position: refs/heads/master@{#524980} diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc index 437e0b9..8a2c00c 100644 --- a/gpu/command_buffer/service/texture_manager.cc +++ b/gpu/command_buffer/service/texture_manager.cc @@ -9,6 +9,7 @@ #include #include +#include #include #include "base/bits.h" @@ -283,21 +284,16 @@ } private: - // TODO(zmo): once std::tuple is allowed, switch over to that. - struct FormatType { - GLenum internal_format; - GLenum format; - GLenum type; - }; - + // FormatType is a tuple of + typedef std::tuple FormatType; struct FormatTypeCompare { bool operator() (const FormatType& lhs, const FormatType& rhs) const { - return (lhs.internal_format < rhs.internal_format || - ((lhs.internal_format == rhs.internal_format) && - (lhs.format < rhs.format)) || - ((lhs.internal_format == rhs.internal_format) && - (lhs.format == rhs.format) && - (lhs.type < rhs.type))); + return (std::get<0>(lhs) < std::get<0>(rhs) || + ((std::get<0>(lhs) == std::get<0>(rhs)) && + (std::get<1>(lhs) < std::get<1>(rhs))) || + ((std::get<0>(lhs) == std::get<0>(rhs)) && + (std::get<1>(lhs) == std::get<1>(rhs)) && + (std::get<2>(lhs) < std::get<2>(rhs)))); } };