1 // Copyright 2018 The Chromium Authors. All rights reserved. 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 THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_MULTI_DRAW_COMMON_H_ 6 #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_MULTI_DRAW_COMMON_H_ 7 8 #include "base/containers/span.h" 9 #include "third_party/blink/renderer/bindings/modules/v8/int32_array_or_long_sequence.h" 10 #include "third_party/blink/renderer/modules/webgl/webgl_extension.h" 11 12 namespace blink { 13 14 class WebGLExtensionScopedContext; 15 class WebGLMultiDrawCommon { 16 protected: 17 bool ValidateDrawcount(WebGLExtensionScopedContext* scoped, 18 const char* function_name, 19 GLsizei drawcount); 20 21 bool ValidateArray(WebGLExtensionScopedContext* scoped, 22 const char* function_name, 23 const char* outOfBoundsDescription, 24 size_t size, 25 GLuint offset, 26 GLsizei drawcount); 27 28 static base::span<const int32_t> MakeSpan( 29 const Int32ArrayOrLongSequence& array); 30 }; 31 32 } // namespace blink 33 34 #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_WEBGL_MULTI_DRAW_COMMON_H_ 35