summaryrefslogtreecommitdiffstats
path: root/cc/scheduler
diff options
context:
space:
mode:
authortomhudson@google.com <tomhudson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 15:01:50 +0000
committertomhudson@google.com <tomhudson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 15:01:50 +0000
commitb992782c3d48258799d34fdd48f931078e39f979 (patch)
tree45718bf908d2230d15b59f2c77d506b2f14ee0df /cc/scheduler
parent9976c1d42b52e4228cf998afb03267f2d3b3ce40 (diff)
downloadchromium_src-b992782c3d48258799d34fdd48f931078e39f979.zip
chromium_src-b992782c3d48258799d34fdd48f931078e39f979.tar.gz
chromium_src-b992782c3d48258799d34fdd48f931078e39f979.tar.bz2
Revert "Adding support for RGBA_4444 tile textures"
This reverts commit 8e6d15826280b9f11a28060b5b2d2bbef17d15bc (r223830; http://crrev.com/21159007). Although the 4444 textures work on S4, they break on N7v2 and N10. (We've got inconsistent reports about N4.) Passing --disable-4444-textures isn't sufficient to fix the problems. ilevy@ points out that the commit bot is using GN, so could easily have missed this breakage. We're hoping to switch to N4, but in this case there's no guarantee that that would have caught it either. Perhaps the main patch can be landed in pieces next time? From N7: E/chromium(32513): [ERROR:gles2_cmd_decoder.cc(5770)] [.RenderCompositor-0x783c9880]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete' From N10: I/chromium( 2104): [INFO:CONSOLE(0)] "[.WebGLRenderingContext]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'", source: file:///sdcard/clanktemp/index.html (0) R=skyostil@chromium.org TBR=kaanb@chromium.org BUG=245774,272539 Review URL: https://codereview.chromium.org/24219002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223871 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/scheduler')
-rw-r--r--cc/scheduler/texture_uploader.cc24
-rw-r--r--cc/scheduler/texture_uploader.h8
-rw-r--r--cc/scheduler/texture_uploader_unittest.cc26
3 files changed, 28 insertions, 30 deletions
diff --git a/cc/scheduler/texture_uploader.cc b/cc/scheduler/texture_uploader.cc
index 207bae2..920c38e 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,
- ResourceFormat format,
+ GLenum 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,
- ResourceFormat format) {
+ GLenum 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 bytes_per_pixel = ResourceProvider::BytesPerPixel(format);
+ unsigned int bytes_per_pixel = Resource::BytesPerPixel(format);
// Use 4-byte row alignment (OpenGL default) for upload performance.
// Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
- unsigned upload_image_stride =
+ unsigned int 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(),
- ResourceProvider::GetGLDataFormat(format),
- ResourceProvider::GetGLDataType(format),
+ format,
+ GL_UNSIGNED_BYTE,
pixel_source);
}
@@ -248,7 +248,7 @@ void TextureUploader::UploadWithMapTexSubImage(const uint8* image,
gfx::Rect image_rect,
gfx::Rect source_rect,
gfx::Vector2d dest_offset,
- ResourceFormat format) {
+ GLenum 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 bytes_per_pixel = ResourceProvider::BytesPerPixel(format);
+ unsigned int bytes_per_pixel = Resource::BytesPerPixel(format);
// Use 4-byte row alignment (OpenGL default) for upload performance.
// Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
- unsigned upload_image_stride =
+ unsigned int upload_image_stride =
RoundUp(bytes_per_pixel * source_rect.width(), 4u);
// Upload tile data via a mapped transfer buffer
@@ -291,10 +291,8 @@ void TextureUploader::UploadWithMapTexSubImage(const uint8* image,
dest_offset.y(),
source_rect.width(),
source_rect.height(),
- ResourceProvider::GetGLDataFormat(
- format),
- ResourceProvider::GetGLDataType(
- format),
+ format,
+ GL_UNSIGNED_BYTE,
GL_WRITE_ONLY));
if (!pixel_dest) {
diff --git a/cc/scheduler/texture_uploader.h b/cc/scheduler/texture_uploader.h
index a131ba0..1457bed 100644
--- a/cc/scheduler/texture_uploader.h
+++ b/cc/scheduler/texture_uploader.h
@@ -11,7 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "cc/base/cc_export.h"
#include "cc/base/scoped_ptr_deque.h"
-#include "cc/resources/resource_provider.h"
+#include "third_party/khronos/GLES2/gl2.h"
namespace WebKit { class WebGraphicsContext3D; }
@@ -46,7 +46,7 @@ class CC_EXPORT TextureUploader {
gfx::Rect content_rect,
gfx::Rect source_rect,
gfx::Vector2d dest_offset,
- ResourceFormat format,
+ GLenum format,
gfx::Size size);
void Flush();
@@ -97,12 +97,12 @@ class CC_EXPORT TextureUploader {
gfx::Rect image_rect,
gfx::Rect source_rect,
gfx::Vector2d dest_offset,
- ResourceFormat format);
+ GLenum format);
void UploadWithMapTexSubImage(const uint8* image,
gfx::Rect image_rect,
gfx::Rect source_rect,
gfx::Vector2d dest_offset,
- ResourceFormat format);
+ GLenum format);
WebKit::WebGraphicsContext3D* context_;
ScopedPtrDeque<Query> pending_queries_;
diff --git a/cc/scheduler/texture_uploader_unittest.cc b/cc/scheduler/texture_uploader_unittest.cc
index 68413df..0595917 100644
--- a/cc/scheduler/texture_uploader_unittest.cc
+++ b/cc/scheduler/texture_uploader_unittest.cc
@@ -151,7 +151,7 @@ class TestWebGraphicsContext3DTextureUpload : public TestWebGraphicsContext3D {
};
void UploadTexture(TextureUploader* uploader,
- ResourceFormat format,
+ WGC3Denum format,
gfx::Size size,
const uint8* data) {
uploader->Upload(data,
@@ -170,17 +170,17 @@ TEST(TextureUploaderTest, NumBlockingUploads) {
fake_context->SetResultAvailable(0);
EXPECT_EQ(0u, uploader->NumBlockingUploads());
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(), NULL);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL);
EXPECT_EQ(1u, uploader->NumBlockingUploads());
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(), NULL);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL);
EXPECT_EQ(2u, uploader->NumBlockingUploads());
fake_context->SetResultAvailable(1);
EXPECT_EQ(0u, uploader->NumBlockingUploads());
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(), NULL);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL);
EXPECT_EQ(0u, uploader->NumBlockingUploads());
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(), NULL);
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(), NULL);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL);
EXPECT_EQ(0u, uploader->NumBlockingUploads());
}
@@ -192,18 +192,18 @@ TEST(TextureUploaderTest, MarkPendingUploadsAsNonBlocking) {
fake_context->SetResultAvailable(0);
EXPECT_EQ(0u, uploader->NumBlockingUploads());
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(), NULL);
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(), NULL);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL);
EXPECT_EQ(2u, uploader->NumBlockingUploads());
uploader->MarkPendingUploadsAsNonBlocking();
EXPECT_EQ(0u, uploader->NumBlockingUploads());
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(), NULL);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL);
EXPECT_EQ(1u, uploader->NumBlockingUploads());
fake_context->SetResultAvailable(1);
EXPECT_EQ(0u, uploader->NumBlockingUploads());
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(), NULL);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(), NULL);
uploader->MarkPendingUploadsAsNonBlocking();
EXPECT_EQ(0u, uploader->NumBlockingUploads());
}
@@ -222,7 +222,7 @@ TEST(TextureUploaderTest, UploadContentsTest) {
buffer[i * 4 * 256] = 0x1;
buffer[(i + 1) * 4 * 256 - 1] = 0x2;
}
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(256, 256), buffer);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(256, 256), buffer);
// Upload a tightly packed 41x43 RGBA texture.
memset(buffer, 0, sizeof(buffer));
@@ -231,7 +231,7 @@ TEST(TextureUploaderTest, UploadContentsTest) {
buffer[i * 4 * 41] = 0x1;
buffer[(i + 1) * 4 * 41 - 1] = 0x2;
}
- UploadTexture(uploader.get(), RGBA_8888, gfx::Size(41, 43), buffer);
+ UploadTexture(uploader.get(), GL_RGBA, gfx::Size(41, 43), buffer);
// Upload a tightly packed 82x86 LUMINANCE texture.
memset(buffer, 0, sizeof(buffer));
@@ -240,7 +240,7 @@ TEST(TextureUploaderTest, UploadContentsTest) {
buffer[i * 1 * 82] = 0x1;
buffer[(i + 1) * 82 - 1] = 0x2;
}
- UploadTexture(uploader.get(), LUMINANCE_8, gfx::Size(82, 86), buffer);
+ UploadTexture(uploader.get(), GL_LUMINANCE, gfx::Size(82, 86), buffer);
}
} // namespace