Skip to content

Commit

Permalink
Revert of cc: Added RED_8 to the ResourceFormat enum (patchset #2 id:…
Browse files Browse the repository at this point in the history
…20001 of https://codereview.chromium.org/735493003/)

Reason for revert:
Reverting the CL because it broke the CrOS ozone compile. See http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Ozone%20Builder/builds/7795/steps/compile/logs/stdio

Original issue's description:
> cc: Added RED_8 to the ResourceFormat enum
>
> New ResourceFormat, RED_8, which translates to GL_UNSIGNED_BYTE on format
> GL_RED_EXT.  This will be used during YUV playback.
>
> At the moment nothing uses it.
>
> BUG=435379
>
> Committed: https://crrev.com/7550d17cfdab5d173f37e5b58cbd2cfeef3d0ed0
> Cr-Commit-Position: refs/heads/master@{#306383}

TBR=vmpstr@chromium.org,danakj@chromium.org,reveman@chromium.org,hendrikw@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=435379

Review URL: https://codereview.chromium.org/775663002

Cr-Commit-Position: refs/heads/master@{#306384}
  • Loading branch information
pkotwicz authored and Commit bot committed Dec 2, 2014
1 parent 7550d17 commit 5ea1c62
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 41 deletions.
1 change: 0 additions & 1 deletion cc/resources/raster_worker_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ static bool IsSupportedPlaybackToMemoryFormat(ResourceFormat format) {
case LUMINANCE_8:
case RGB_565:
case ETC1:
case RED_8:
return false;
}
NOTREACHED();
Expand Down
1 change: 0 additions & 1 deletion cc/resources/resource_format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ SkColorType ResourceFormatToSkColorType(ResourceFormat format) {
case ALPHA_8:
case LUMINANCE_8:
case RGB_565:
case RED_8:
NOTREACHED();
break;
}
Expand Down
3 changes: 1 addition & 2 deletions cc/resources/resource_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ enum ResourceFormat {
LUMINANCE_8,
RGB_565,
ETC1,
RED_8,
RESOURCE_FORMAT_MAX = RED_8,
RESOURCE_FORMAT_MAX = ETC1,
};

SkColorType ResourceFormatToSkColorType(ResourceFormat format);
Expand Down
3 changes: 0 additions & 3 deletions cc/resources/resource_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ GLenum TextureToStorageFormat(ResourceFormat format) {
case LUMINANCE_8:
case RGB_565:
case ETC1:
case RED_8:
NOTREACHED();
break;
}
Expand All @@ -95,7 +94,6 @@ bool IsFormatSupportedForStorage(ResourceFormat format, bool use_bgra) {
case LUMINANCE_8:
case RGB_565:
case ETC1:
case RED_8:
return false;
}
return false;
Expand Down Expand Up @@ -127,7 +125,6 @@ gfx::GpuMemoryBuffer::Format ToGpuMemoryBufferFormat(ResourceFormat format) {
case LUMINANCE_8:
case RGB_565:
case ETC1:
case RED_8:
break;
}
NOTREACHED();
Expand Down
31 changes: 14 additions & 17 deletions cc/resources/resource_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ inline unsigned BitsPerPixel(ResourceFormat format) {
return 16;
case ALPHA_8:
case LUMINANCE_8:
case RED_8:
return 8;
case ETC1:
return 4;
Expand All @@ -622,29 +621,27 @@ inline unsigned BitsPerPixel(ResourceFormat format) {
inline GLenum GLDataType(ResourceFormat format) {
DCHECK_LE(format, RESOURCE_FORMAT_MAX);
static const unsigned format_gl_data_type[RESOURCE_FORMAT_MAX + 1] = {
GL_UNSIGNED_BYTE, // RGBA_8888
GL_UNSIGNED_SHORT_4_4_4_4, // RGBA_4444
GL_UNSIGNED_BYTE, // BGRA_8888
GL_UNSIGNED_BYTE, // ALPHA_8
GL_UNSIGNED_BYTE, // LUMINANCE_8
GL_UNSIGNED_SHORT_5_6_5, // RGB_565,
GL_UNSIGNED_BYTE, // ETC1
GL_UNSIGNED_BYTE // RED_8
GL_UNSIGNED_BYTE, // RGBA_8888
GL_UNSIGNED_SHORT_4_4_4_4, // RGBA_4444
GL_UNSIGNED_BYTE, // BGRA_8888
GL_UNSIGNED_BYTE, // ALPHA_8
GL_UNSIGNED_BYTE, // LUMINANCE_8
GL_UNSIGNED_SHORT_5_6_5, // RGB_565,
GL_UNSIGNED_BYTE // ETC1
};
return format_gl_data_type[format];
}

inline GLenum GLDataFormat(ResourceFormat format) {
DCHECK_LE(format, RESOURCE_FORMAT_MAX);
static const unsigned format_gl_data_format[RESOURCE_FORMAT_MAX + 1] = {
GL_RGBA, // RGBA_8888
GL_RGBA, // RGBA_4444
GL_BGRA_EXT, // BGRA_8888
GL_ALPHA, // ALPHA_8
GL_LUMINANCE, // LUMINANCE_8
GL_RGB, // RGB_565
GL_ETC1_RGB8_OES, // ETC1
GL_RED_EXT // RED_8
GL_RGBA, // RGBA_8888
GL_RGBA, // RGBA_4444
GL_BGRA_EXT, // BGRA_8888
GL_ALPHA, // ALPHA_8
GL_LUMINANCE, // LUMINANCE_8
GL_RGB, // RGB_565
GL_ETC1_RGB8_OES // ETC1
};
return format_gl_data_format[format];
}
Expand Down
17 changes: 0 additions & 17 deletions cc/resources/texture_uploader_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ class TextureUploadTestContext : public gpu::gles2::GLES2InterfaceStub {
EXPECT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type);
bytes_per_pixel = 2;
break;
case GL_RED_EXT:
EXPECT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type);
bytes_per_pixel = 1;
break;
case GL_RG_EXT:
EXPECT_EQ(static_cast<unsigned>(GL_UNSIGNED_BYTE), type);
bytes_per_pixel = 2;
break;
}

// If NULL, we aren't checking texture contents.
Expand Down Expand Up @@ -240,15 +232,6 @@ TEST(TextureUploaderTest, UploadContentsTest) {
buffer[(i + 1) * 82 - 1] = 0x2;
}
UploadTexture(uploader.get(), LUMINANCE_8, gfx::Size(82, 86), buffer);

// Upload a tightly packed 82x86 RED texture.
memset(buffer, 0, sizeof(buffer));
for (int i = 0; i < 86; ++i) {
// Mark the beginning and end of each row, for the test.
buffer[i * 1 * 82] = 0x1;
buffer[(i + 1) * 82 - 1] = 0x2;
}
UploadTexture(uploader.get(), RED_8, gfx::Size(82, 86), buffer);
}

} // namespace
Expand Down

0 comments on commit 5ea1c62

Please sign in to comment.