1 // Copyright 2022 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CORE_FXCRT_FX_2D_SIZE_H_ 6 #define CORE_FXCRT_FX_2D_SIZE_H_ 7 8 #include "core/fxcrt/fx_safe_types.h" 9 10 template <typename T, typename U> Fx2DSizeOrDie(const T & w,const U & h)11size_t Fx2DSizeOrDie(const T& w, const U& h) { 12 FX_SAFE_SIZE_T safe_size = w; 13 safe_size *= h; 14 return safe_size.ValueOrDie(); 15 } 16 17 #endif // CORE_FXCRT_FX_2D_SIZE_H_ 18