summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/context_state.cc
diff options
context:
space:
mode:
authorzmo <zmo@chromium.org>2015-12-09 15:13:15 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-09 23:14:02 +0000
commitfc27654db19f5495a9ad541ee27cf68a804fc632 (patch)
treea61b4804222bb92dcd2efad2def9a7edbff1f9a0 /gpu/command_buffer/service/context_state.cc
parentac8224c8a42e794b9c496f7e718a4fc4764e3c9e (diff)
downloadchromium_src-fc27654db19f5495a9ad541ee27cf68a804fc632.zip
chromium_src-fc27654db19f5495a9ad541ee27cf68a804fc632.tar.gz
chromium_src-fc27654db19f5495a9ad541ee27cf68a804fc632.tar.bz2
Reland: Implement helper functionalities for computing image size with ES3 settings.
This will be used in ReadPixels, Tex{Sub}Image* in followup CLs. Original reviewed CL is https://codereview.chromium.org/1508953002/ BUG=429053,563714 TEST=gpu_unittests TBR=piman@chromium.org Review URL: https://codereview.chromium.org/1513013002 Cr-Commit-Position: refs/heads/master@{#364200}
Diffstat (limited to 'gpu/command_buffer/service/context_state.cc')
-rw-r--r--gpu/command_buffer/service/context_state.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc
index b93a372..4cbf294 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -594,6 +594,28 @@ void ContextState::UnbindSampler(Sampler* sampler) {
}
}
+PixelStoreParams ContextState::GetPackParams() {
+ PixelStoreParams params;
+ params.alignment = pack_alignment;
+ params.row_length = pack_row_length;
+ params.skip_pixels = pack_skip_pixels;
+ params.skip_rows = pack_skip_rows;
+ return params;
+}
+
+PixelStoreParams ContextState::GetUnpackParams(Dimension dimension) {
+ PixelStoreParams params;
+ params.alignment = unpack_alignment;
+ params.row_length = unpack_row_length;
+ params.skip_pixels = unpack_skip_pixels;
+ params.skip_rows = unpack_skip_rows;
+ if (dimension == k3D) {
+ params.image_height = unpack_image_height;
+ params.skip_images = unpack_skip_images;
+ }
+ return params;
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.