Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: gpu/command_buffer/service/context_state.cc

Issue 2076213002: Decompress ETC texture data when there is no native support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unpack alignment Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 glBindTexture(GL_TEXTURE_CUBE_MAP, service_id_cube); 258 glBindTexture(GL_TEXTURE_CUBE_MAP, service_id_cube);
259 } 259 }
260 if (bind_texture_oes) { 260 if (bind_texture_oes) {
261 glBindTexture(GL_TEXTURE_EXTERNAL_OES, service_id_oes); 261 glBindTexture(GL_TEXTURE_EXTERNAL_OES, service_id_oes);
262 } 262 }
263 if (bind_texture_arb) { 263 if (bind_texture_arb) {
264 glBindTexture(GL_TEXTURE_RECTANGLE_ARB, service_id_arb); 264 glBindTexture(GL_TEXTURE_RECTANGLE_ARB, service_id_arb);
265 } 265 }
266 } 266 }
267 267
268 void ContextState::RestoreUnpackState() const {
269 glBindBuffer(GL_PIXEL_UNPACK_BUFFER,
270 GetBufferId(bound_pixel_unpack_buffer.get()));
271 glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
272 glPixelStorei(GL_UNPACK_SKIP_ROWS, unpack_skip_rows);
273 glPixelStorei(GL_UNPACK_SKIP_PIXELS, unpack_skip_images);
274 glPixelStorei(GL_UNPACK_SKIP_IMAGES, unpack_skip_images);
piman 2016/07/08 19:30:39 We never pass GL_UNPACK_SKIP_ROWS/PIXELS/IMAGES to
275
276 // UpdateUnpackParameters restores the GL_UNPACK_ROW_LENGTH and
277 // GL_UNPACK_IMAGE_HEIGHT parameters
278 UpdateUnpackParameters();
279 }
280
268 void ContextState::RestoreBufferBindings() const { 281 void ContextState::RestoreBufferBindings() const {
269 if (vertex_attrib_manager.get()) { 282 if (vertex_attrib_manager.get()) {
270 Buffer* element_array_buffer = 283 Buffer* element_array_buffer =
271 vertex_attrib_manager->element_array_buffer(); 284 vertex_attrib_manager->element_array_buffer();
272 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, GetBufferId(element_array_buffer)); 285 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, GetBufferId(element_array_buffer));
273 } 286 }
274 glBindBuffer(GL_ARRAY_BUFFER, GetBufferId(bound_array_buffer.get())); 287 glBindBuffer(GL_ARRAY_BUFFER, GetBufferId(bound_array_buffer.get()));
275 if (feature_info_->IsES3Capable()) { 288 if (feature_info_->IsES3Capable()) {
276 glBindBuffer(GL_COPY_READ_BUFFER, 289 glBindBuffer(GL_COPY_READ_BUFFER,
277 GetBufferId(bound_copy_read_buffer.get())); 290 GetBufferId(bound_copy_read_buffer.get()));
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 UpdateUnpackParameters(); 680 UpdateUnpackParameters();
668 } 681 }
669 682
670 // Include the auto-generated part of this file. We split this because it means 683 // Include the auto-generated part of this file. We split this because it means
671 // we can easily edit the non-auto generated parts right here in this file 684 // we can easily edit the non-auto generated parts right here in this file
672 // instead of having to edit some template or the code generator. 685 // instead of having to edit some template or the code generator.
673 #include "gpu/command_buffer/service/context_state_impl_autogen.h" 686 #include "gpu/command_buffer/service/context_state_impl_autogen.h"
674 687
675 } // namespace gles2 688 } // namespace gles2
676 } // namespace gpu 689 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698