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

Unified Diff: cc/resources/resource_provider.cc

Issue 2544893006: Revert of Reland "Fix HTML5 video blurry" (Closed)
Patch Set: Created 4 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 | « cc/resources/resource_provider.h ('k') | cc/resources/video_resource_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 89ec99ef5e709b4fc8f5eb1ba8f9d3fa3a4d7dd9..1be0b13564fc2774c44982e9f0bd6b967f5b2138 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -411,6 +411,7 @@
use_texture_format_bgra_(false),
use_texture_usage_hint_(false),
use_compressed_texture_etc1_(false),
+ yuv_resource_format_(LUMINANCE_8),
max_texture_size_(0),
best_texture_format_(RGBA_8888),
best_render_buffer_format_(RGBA_8888),
@@ -448,6 +449,15 @@
use_texture_format_bgra_ = caps.texture_format_bgra8888;
use_texture_usage_hint_ = caps.texture_usage;
use_compressed_texture_etc1_ = caps.texture_format_etc1;
+
+ if (caps.disable_one_component_textures) {
+ yuv_resource_format_ = yuv_highbit_resource_format_ = RGBA_8888;
+ } else {
+ yuv_resource_format_ = caps.texture_rg ? RED_8 : LUMINANCE_8;
+ yuv_highbit_resource_format_ =
+ caps.texture_half_float_linear ? LUMINANCE_F16 : yuv_resource_format_;
+ }
+
use_sync_query_ = caps.sync_query;
GLES2Interface* gl = ContextGL();
@@ -537,6 +547,14 @@
Resource* resource = GetResource(id);
DCHECK(resource);
resource->lost = true;
+}
+
+ResourceFormat ResourceProvider::YuvResourceFormat(int bits) const {
+ if (bits > 8) {
+ return yuv_highbit_resource_format_;
+ } else {
+ return yuv_resource_format_;
+ }
}
ResourceId ResourceProvider::CreateResource(
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/resources/video_resource_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698