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

Unified Diff: cc/resources/video_resource_updater.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/resources/video_resource_updater.h ('k') | cc/resources/video_resource_updater_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index d07ff35b1a097a6718602addcc7511606f39f9ae..34c7ab65c35d40bfcd9f9655f7e3b32f5ba176e1 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -15,11 +15,11 @@
#include "third_party/khronos/GLES2/gl2ext.h"
#include "ui/gfx/size_conversions.h"
-const unsigned kYUVResourceFormat = GL_LUMINANCE;
-const unsigned kRGBResourceFormat = GL_RGBA;
-
namespace cc {
+const ResourceFormat kYUVResourceFormat = LUMINANCE_8;
+const ResourceFormat kRGBResourceFormat = RGBA_8888;
+
VideoFrameExternalResources::VideoFrameExternalResources() : type(NONE) {}
VideoFrameExternalResources::~VideoFrameExternalResources() {}
@@ -90,7 +90,7 @@ bool VideoResourceUpdater::VerifyFrame(
static gfx::Size SoftwarePlaneDimension(
media::VideoFrame::Format input_frame_format,
gfx::Size coded_size,
- GLenum output_resource_format,
+ ResourceFormat output_resource_format,
int plane_index) {
if (output_resource_format == kYUVResourceFormat) {
if (plane_index == media::VideoFrame::kYPlane ||
@@ -116,7 +116,7 @@ static gfx::Size SoftwarePlaneDimension(
}
}
- DCHECK_EQ(output_resource_format, static_cast<unsigned>(kRGBResourceFormat));
+ DCHECK_EQ(output_resource_format, kRGBResourceFormat);
return coded_size;
}
@@ -143,7 +143,7 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
bool software_compositor = context_provider_ == NULL;
- GLenum output_resource_format = kYUVResourceFormat;
+ ResourceFormat output_resource_format = kYUVResourceFormat;
size_t output_plane_count =
(input_frame_format == media::VideoFrame::YV12A) ? 4 : 3;
@@ -194,9 +194,9 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
// ResourceProvider and stop using ResourceProvider in this class.
resource_id =
resource_provider_->CreateResource(output_plane_resource_size,
- output_resource_format,
GL_CLAMP_TO_EDGE,
- ResourceProvider::TextureUsageAny);
+ ResourceProvider::TextureUsageAny,
+ output_resource_format);
DCHECK(mailbox.IsZero());
@@ -284,8 +284,7 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
for (size_t i = 0; i < plane_resources.size(); ++i) {
// Update each plane's resource id with its content.
- DCHECK_EQ(plane_resources[i].resource_format,
- static_cast<unsigned>(kYUVResourceFormat));
+ DCHECK_EQ(plane_resources[i].resource_format, kYUVResourceFormat);
const uint8_t* input_plane_pixels = video_frame->data(i);
« no previous file with comments | « cc/resources/video_resource_updater.h ('k') | cc/resources/video_resource_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698