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

Side by Side Diff: cc/resources/resource_provider.cc

Issue 759753005: cc: Enable GL_RED_EXT for YUV resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext_texture_rg2
Patch Set: Enable GL_RED_EXT for YUV Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/resource_provider.h" 5 #include "cc/resources/resource_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 blocking_main_thread_task_runner_(blocking_main_thread_task_runner), 1212 blocking_main_thread_task_runner_(blocking_main_thread_task_runner),
1213 lost_output_surface_(false), 1213 lost_output_surface_(false),
1214 highp_threshold_min_(highp_threshold_min), 1214 highp_threshold_min_(highp_threshold_min),
1215 next_id_(1), 1215 next_id_(1),
1216 next_child_(1), 1216 next_child_(1),
1217 default_resource_type_(InvalidType), 1217 default_resource_type_(InvalidType),
1218 use_texture_storage_ext_(false), 1218 use_texture_storage_ext_(false),
1219 use_texture_format_bgra_(false), 1219 use_texture_format_bgra_(false),
1220 use_texture_usage_hint_(false), 1220 use_texture_usage_hint_(false),
1221 use_compressed_texture_etc1_(false), 1221 use_compressed_texture_etc1_(false),
1222 yuv_resource_format_(LUMINANCE_8),
1222 max_texture_size_(0), 1223 max_texture_size_(0),
1223 best_texture_format_(RGBA_8888), 1224 best_texture_format_(RGBA_8888),
1224 use_rgba_4444_texture_format_(use_rgba_4444_texture_format), 1225 use_rgba_4444_texture_format_(use_rgba_4444_texture_format),
1225 id_allocation_chunk_size_(id_allocation_chunk_size), 1226 id_allocation_chunk_size_(id_allocation_chunk_size),
1226 use_sync_query_(false) { 1227 use_sync_query_(false) {
1227 DCHECK(output_surface_->HasClient()); 1228 DCHECK(output_surface_->HasClient());
1228 DCHECK(id_allocation_chunk_size_); 1229 DCHECK(id_allocation_chunk_size_);
1229 } 1230 }
1230 1231
1231 void ResourceProvider::InitializeSoftware() { 1232 void ResourceProvider::InitializeSoftware() {
(...skipping 18 matching lines...) Expand all
1250 default_resource_type_ = GLTexture; 1251 default_resource_type_ = GLTexture;
1251 1252
1252 const ContextProvider::Capabilities& caps = 1253 const ContextProvider::Capabilities& caps =
1253 output_surface_->context_provider()->ContextCapabilities(); 1254 output_surface_->context_provider()->ContextCapabilities();
1254 1255
1255 bool use_bgra = caps.gpu.texture_format_bgra8888; 1256 bool use_bgra = caps.gpu.texture_format_bgra8888;
1256 use_texture_storage_ext_ = caps.gpu.texture_storage; 1257 use_texture_storage_ext_ = caps.gpu.texture_storage;
1257 use_texture_format_bgra_ = caps.gpu.texture_format_bgra8888; 1258 use_texture_format_bgra_ = caps.gpu.texture_format_bgra8888;
1258 use_texture_usage_hint_ = caps.gpu.texture_usage; 1259 use_texture_usage_hint_ = caps.gpu.texture_usage;
1259 use_compressed_texture_etc1_ = caps.gpu.texture_format_etc1; 1260 use_compressed_texture_etc1_ = caps.gpu.texture_format_etc1;
1261 yuv_resource_format_ = caps.gpu.texture_rg ? RED_8 : LUMINANCE_8;
1260 use_sync_query_ = caps.gpu.sync_query; 1262 use_sync_query_ = caps.gpu.sync_query;
1261 1263
1262 GLES2Interface* gl = ContextGL(); 1264 GLES2Interface* gl = ContextGL();
1263 DCHECK(gl); 1265 DCHECK(gl);
1264 1266
1265 texture_uploader_ = TextureUploader::Create(gl); 1267 texture_uploader_ = TextureUploader::Create(gl);
1266 max_texture_size_ = 0; // Context expects cleared value. 1268 max_texture_size_ = 0; // Context expects cleared value.
1267 GLC(gl, gl->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size_)); 1269 GLC(gl, gl->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size_));
1268 best_texture_format_ = PlatformColor::BestTextureFormat(use_bgra); 1270 best_texture_format_ = PlatformColor::BestTextureFormat(use_bgra);
1269 1271
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 ContextProvider* context_provider = output_surface_->context_provider(); 2159 ContextProvider* context_provider = output_surface_->context_provider();
2158 return context_provider ? context_provider->ContextGL() : NULL; 2160 return context_provider ? context_provider->ContextGL() : NULL;
2159 } 2161 }
2160 2162
2161 class GrContext* ResourceProvider::GrContext() const { 2163 class GrContext* ResourceProvider::GrContext() const {
2162 ContextProvider* context_provider = output_surface_->context_provider(); 2164 ContextProvider* context_provider = output_surface_->context_provider();
2163 return context_provider ? context_provider->GrContext() : NULL; 2165 return context_provider ? context_provider->GrContext() : NULL;
2164 } 2166 }
2165 2167
2166 } // namespace cc 2168 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698