OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "gpu/command_buffer/service/context_state.h" | 5 #include "gpu/command_buffer/service/context_state.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
10 #include "gpu/command_buffer/service/buffer_manager.h" | 10 #include "gpu/command_buffer/service/buffer_manager.h" |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 | 587 |
588 void ContextState::UnbindSampler(Sampler* sampler) { | 588 void ContextState::UnbindSampler(Sampler* sampler) { |
589 for (size_t jj = 0; jj < sampler_units.size(); ++jj) { | 589 for (size_t jj = 0; jj < sampler_units.size(); ++jj) { |
590 if (sampler_units[jj].get() == sampler) { | 590 if (sampler_units[jj].get() == sampler) { |
591 sampler_units[jj] = nullptr; | 591 sampler_units[jj] = nullptr; |
592 glBindSampler(jj, 0); | 592 glBindSampler(jj, 0); |
593 } | 593 } |
594 } | 594 } |
595 } | 595 } |
596 | 596 |
| 597 PixelStoreParams ContextState::GetPackParams() { |
| 598 PixelStoreParams params; |
| 599 params.alignment = pack_alignment; |
| 600 params.row_length = pack_row_length; |
| 601 params.skip_pixels = pack_skip_pixels; |
| 602 params.skip_rows = pack_skip_rows; |
| 603 return params; |
| 604 } |
| 605 |
| 606 PixelStoreParams ContextState::GetUnpackParams(Dimension dimension) { |
| 607 PixelStoreParams params; |
| 608 params.alignment = unpack_alignment; |
| 609 params.row_length = unpack_row_length; |
| 610 params.skip_pixels = unpack_skip_pixels; |
| 611 params.skip_rows = unpack_skip_rows; |
| 612 if (dimension == k3D) { |
| 613 params.image_height = unpack_image_height; |
| 614 params.skip_images = unpack_skip_images; |
| 615 } |
| 616 return params; |
| 617 } |
| 618 |
597 // Include the auto-generated part of this file. We split this because it means | 619 // Include the auto-generated part of this file. We split this because it means |
598 // we can easily edit the non-auto generated parts right here in this file | 620 // we can easily edit the non-auto generated parts right here in this file |
599 // instead of having to edit some template or the code generator. | 621 // instead of having to edit some template or the code generator. |
600 #include "gpu/command_buffer/service/context_state_impl_autogen.h" | 622 #include "gpu/command_buffer/service/context_state_impl_autogen.h" |
601 | 623 |
602 } // namespace gles2 | 624 } // namespace gles2 |
603 } // namespace gpu | 625 } // namespace gpu |
OLD | NEW |