| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file is auto-generated from | 5 // This file is auto-generated from |
| 6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
| 7 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
| 8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
| 9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
| 10 | 10 |
| (...skipping 15627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15638 static_assert(offsetof(OverlayPromotionHintCHROMIUM, texture) == 4, | 15638 static_assert(offsetof(OverlayPromotionHintCHROMIUM, texture) == 4, |
| 15639 "offset of OverlayPromotionHintCHROMIUM texture should be 4"); | 15639 "offset of OverlayPromotionHintCHROMIUM texture should be 4"); |
| 15640 static_assert( | 15640 static_assert( |
| 15641 offsetof(OverlayPromotionHintCHROMIUM, promotion_hint) == 8, | 15641 offsetof(OverlayPromotionHintCHROMIUM, promotion_hint) == 8, |
| 15642 "offset of OverlayPromotionHintCHROMIUM promotion_hint should be 8"); | 15642 "offset of OverlayPromotionHintCHROMIUM promotion_hint should be 8"); |
| 15643 static_assert(offsetof(OverlayPromotionHintCHROMIUM, display_x) == 12, | 15643 static_assert(offsetof(OverlayPromotionHintCHROMIUM, display_x) == 12, |
| 15644 "offset of OverlayPromotionHintCHROMIUM display_x should be 12"); | 15644 "offset of OverlayPromotionHintCHROMIUM display_x should be 12"); |
| 15645 static_assert(offsetof(OverlayPromotionHintCHROMIUM, display_y) == 16, | 15645 static_assert(offsetof(OverlayPromotionHintCHROMIUM, display_y) == 16, |
| 15646 "offset of OverlayPromotionHintCHROMIUM display_y should be 16"); | 15646 "offset of OverlayPromotionHintCHROMIUM display_y should be 16"); |
| 15647 | 15647 |
| 15648 struct SwapBuffersWithDamageCHROMIUM { | 15648 struct SwapBuffersWithBoundsCHROMIUMImmediate { |
| 15649 typedef SwapBuffersWithDamageCHROMIUM ValueType; | 15649 typedef SwapBuffersWithBoundsCHROMIUMImmediate ValueType; |
| 15650 static const CommandId kCmdId = kSwapBuffersWithDamageCHROMIUM; | 15650 static const CommandId kCmdId = kSwapBuffersWithBoundsCHROMIUMImmediate; |
| 15651 static const cmd::ArgFlags kArgFlags = cmd::kFixed; | 15651 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; |
| 15652 static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); | 15652 static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); |
| 15653 | 15653 |
| 15654 static uint32_t ComputeSize() { | 15654 static uint32_t ComputeDataSize(GLsizei count) { |
| 15655 return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT | 15655 return static_cast<uint32_t>(sizeof(GLint) * 4 * count); // NOLINT |
| 15656 } | 15656 } |
| 15657 | 15657 |
| 15658 void SetHeader() { header.SetCmd<ValueType>(); } | 15658 static uint32_t ComputeSize(GLsizei count) { |
| 15659 | 15659 return static_cast<uint32_t>(sizeof(ValueType) + |
| 15660 void Init(GLint _x, GLint _y, GLint _width, GLint _height) { | 15660 ComputeDataSize(count)); // NOLINT |
| 15661 SetHeader(); | |
| 15662 x = _x; | |
| 15663 y = _y; | |
| 15664 width = _width; | |
| 15665 height = _height; | |
| 15666 } | 15661 } |
| 15667 | 15662 |
| 15668 void* Set(void* cmd, GLint _x, GLint _y, GLint _width, GLint _height) { | 15663 void SetHeader(GLsizei count) { |
| 15669 static_cast<ValueType*>(cmd)->Init(_x, _y, _width, _height); | 15664 header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); |
| 15670 return NextCmdAddress<ValueType>(cmd); | 15665 } |
| 15666 |
| 15667 void Init(GLsizei _count, const GLint* _rects) { |
| 15668 SetHeader(_count); |
| 15669 count = _count; |
| 15670 memcpy(ImmediateDataAddress(this), _rects, ComputeDataSize(_count)); |
| 15671 } |
| 15672 |
| 15673 void* Set(void* cmd, GLsizei _count, const GLint* _rects) { |
| 15674 static_cast<ValueType*>(cmd)->Init(_count, _rects); |
| 15675 const uint32_t size = ComputeSize(_count); |
| 15676 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size); |
| 15671 } | 15677 } |
| 15672 | 15678 |
| 15673 gpu::CommandHeader header; | 15679 gpu::CommandHeader header; |
| 15674 int32_t x; | 15680 int32_t count; |
| 15675 int32_t y; | |
| 15676 int32_t width; | |
| 15677 int32_t height; | |
| 15678 }; | 15681 }; |
| 15679 | 15682 |
| 15680 static_assert(sizeof(SwapBuffersWithDamageCHROMIUM) == 20, | 15683 static_assert(sizeof(SwapBuffersWithBoundsCHROMIUMImmediate) == 8, |
| 15681 "size of SwapBuffersWithDamageCHROMIUM should be 20"); | 15684 "size of SwapBuffersWithBoundsCHROMIUMImmediate should be 8"); |
| 15682 static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, header) == 0, | 15685 static_assert( |
| 15683 "offset of SwapBuffersWithDamageCHROMIUM header should be 0"); | 15686 offsetof(SwapBuffersWithBoundsCHROMIUMImmediate, header) == 0, |
| 15684 static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, x) == 4, | 15687 "offset of SwapBuffersWithBoundsCHROMIUMImmediate header should be 0"); |
| 15685 "offset of SwapBuffersWithDamageCHROMIUM x should be 4"); | 15688 static_assert( |
| 15686 static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, y) == 8, | 15689 offsetof(SwapBuffersWithBoundsCHROMIUMImmediate, count) == 4, |
| 15687 "offset of SwapBuffersWithDamageCHROMIUM y should be 8"); | 15690 "offset of SwapBuffersWithBoundsCHROMIUMImmediate count should be 4"); |
| 15688 static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, width) == 12, | |
| 15689 "offset of SwapBuffersWithDamageCHROMIUM width should be 12"); | |
| 15690 static_assert(offsetof(SwapBuffersWithDamageCHROMIUM, height) == 16, | |
| 15691 "offset of SwapBuffersWithDamageCHROMIUM height should be 16"); | |
| 15692 | 15691 |
| 15693 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_ | 15692 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_ |
| OLD | NEW |