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

Unified Diff: cc/resources/texture_uploader.cc

Issue 817673004: cc: TextureUploader - Reset GL_UNPACK_ALIGNMENT to 4 before uploading images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/texture_uploader.cc
diff --git a/cc/resources/texture_uploader.cc b/cc/resources/texture_uploader.cc
index 9526fcb9238bdf5f1d4591aab7184c544d0022f2..cc0ec82a19bbfef49ff13add80d8b595db356ab8 100644
--- a/cc/resources/texture_uploader.cc
+++ b/cc/resources/texture_uploader.cc
@@ -196,7 +196,7 @@ void TextureUploader::UploadWithTexSubImage(const uint8* image,
const uint8* pixel_source;
unsigned bytes_per_pixel = BitsPerPixel(format) / 8;
// Use 4-byte row alignment (OpenGL default) for upload performance.
- // Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
+ // Assuming that GL_UNPACK_ALIGNMENT = 4 is set in UploadWithMapTexSubImage.
unsigned upload_image_stride =
RoundUp(bytes_per_pixel * source_rect.width(), 4u);
@@ -251,7 +251,7 @@ void TextureUploader::UploadWithMapTexSubImage(const uint8* image,
unsigned bytes_per_pixel = BitsPerPixel(format) / 8;
// Use 4-byte row alignment (OpenGL default) for upload performance.
- // Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
+ gl_->PixelStorei(GL_UNPACK_ALIGNMENT, 4);
danakj 2014/12/19 20:00:46 Should we do this when we take control of the cont
vmiura 2014/12/19 21:28:16 If there's a good spot we could do that. Discussi
unsigned upload_image_stride =
RoundUp(bytes_per_pixel * source_rect.width(), 4u);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698