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

Unified Diff: cc/scheduler/texture_uploader.cc

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a signed vs. unsigned comparison in video_resource_updater.cc Created 7 years, 3 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 | « cc/scheduler/texture_uploader.h ('k') | cc/scheduler/texture_uploader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/texture_uploader.cc
diff --git a/cc/scheduler/texture_uploader.cc b/cc/scheduler/texture_uploader.cc
index 920c38e669275d0992d6b5166a1683464aecaad4..207bae23bc68163a906113e570ab15988831b549 100644
--- a/cc/scheduler/texture_uploader.cc
+++ b/cc/scheduler/texture_uploader.cc
@@ -135,7 +135,7 @@ void TextureUploader::Upload(const uint8* image,
gfx::Rect image_rect,
gfx::Rect source_rect,
gfx::Vector2d dest_offset,
- GLenum format,
+ ResourceFormat format,
gfx::Size size) {
CHECK(image_rect.Contains(source_rect));
@@ -178,7 +178,7 @@ void TextureUploader::UploadWithTexSubImage(const uint8* image,
gfx::Rect image_rect,
gfx::Rect source_rect,
gfx::Vector2d dest_offset,
- GLenum format) {
+ ResourceFormat format) {
// Instrumentation to debug issue 156107
int source_rect_x = source_rect.x();
int source_rect_y = source_rect.y();
@@ -207,10 +207,10 @@ void TextureUploader::UploadWithTexSubImage(const uint8* image,
gfx::Vector2d offset(source_rect.origin() - image_rect.origin());
const uint8* pixel_source;
- unsigned int bytes_per_pixel = Resource::BytesPerPixel(format);
+ unsigned bytes_per_pixel = ResourceProvider::BytesPerPixel(format);
// Use 4-byte row alignment (OpenGL default) for upload performance.
// Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
- unsigned int upload_image_stride =
+ unsigned upload_image_stride =
RoundUp(bytes_per_pixel * source_rect.width(), 4u);
if (upload_image_stride == image_rect.width() * bytes_per_pixel &&
@@ -239,8 +239,8 @@ void TextureUploader::UploadWithTexSubImage(const uint8* image,
dest_offset.y(),
source_rect.width(),
source_rect.height(),
- format,
- GL_UNSIGNED_BYTE,
+ ResourceProvider::GetGLDataFormat(format),
+ ResourceProvider::GetGLDataType(format),
pixel_source);
}
@@ -248,7 +248,7 @@ void TextureUploader::UploadWithMapTexSubImage(const uint8* image,
gfx::Rect image_rect,
gfx::Rect source_rect,
gfx::Vector2d dest_offset,
- GLenum format) {
+ ResourceFormat format) {
// Instrumentation to debug issue 156107
int source_rect_x = source_rect.x();
int source_rect_y = source_rect.y();
@@ -277,10 +277,10 @@ void TextureUploader::UploadWithMapTexSubImage(const uint8* image,
// Offset from image-rect to source-rect.
gfx::Vector2d offset(source_rect.origin() - image_rect.origin());
- unsigned int bytes_per_pixel = Resource::BytesPerPixel(format);
+ unsigned bytes_per_pixel = ResourceProvider::BytesPerPixel(format);
// Use 4-byte row alignment (OpenGL default) for upload performance.
// Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
- unsigned int upload_image_stride =
+ unsigned upload_image_stride =
RoundUp(bytes_per_pixel * source_rect.width(), 4u);
// Upload tile data via a mapped transfer buffer
@@ -291,8 +291,10 @@ void TextureUploader::UploadWithMapTexSubImage(const uint8* image,
dest_offset.y(),
source_rect.width(),
source_rect.height(),
- format,
- GL_UNSIGNED_BYTE,
+ ResourceProvider::GetGLDataFormat(
+ format),
+ ResourceProvider::GetGLDataType(
+ format),
GL_WRITE_ONLY));
if (!pixel_dest) {
« no previous file with comments | « cc/scheduler/texture_uploader.h ('k') | cc/scheduler/texture_uploader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698