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

Unified 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: Check MapBuffer result. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/context_state.h ('k') | gpu/command_buffer/service/feature_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/context_state.cc
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc
index b717c04b61c8453f196bb5d21b653ddf23c23706..5440b893c9d7efb49813faee48bf032d5e72cf0c 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -265,6 +265,26 @@ void ContextState::RestoreTextureUnitBindings(
}
}
+void ContextState::PushTextureDecompressionUnpackState() const {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ if (bound_pixel_unpack_buffer.get()) {
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
+ }
+}
+
+void ContextState::RestoreUnpackState() const {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment);
+ if (bound_pixel_unpack_buffer.get()) {
+ glBindBuffer(GL_PIXEL_UNPACK_BUFFER,
+ GetBufferId(bound_pixel_unpack_buffer.get()));
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, unpack_row_length);
+ glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, unpack_image_height);
+ }
+}
+
void ContextState::RestoreBufferBindings() const {
if (vertex_attrib_manager.get()) {
Buffer* element_array_buffer =
« no previous file with comments | « gpu/command_buffer/service/context_state.h ('k') | gpu/command_buffer/service/feature_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698