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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 83883002: cc: Allow TEXTURE_RECTANGLE_ARB to be used for tile textures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback Created 7 years, 1 month 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/test/fake_tile_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 6f267cc51b0417ac65f35299e15a4be158db4da9..9485c72ee1369bae2ceffb45c9b02876400d6a35 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -56,6 +56,7 @@
#include "cc/trees/quad_culler.h"
#include "cc/trees/single_thread_proxy.h"
#include "cc/trees/tree_synchronizer.h"
+#include "gpu/GLES2/gl2extchromium.h"
#include "ui/gfx/frame_time.h"
#include "ui/gfx/size_conversions.h"
#include "ui/gfx/vector2d_conversions.h"
@@ -103,6 +104,22 @@ size_t GetMaxRasterTasksUsageBytes(cc::ContextProvider* context_provider) {
return GetMaxTransferBufferUsageBytes(context_provider);
}
+GLenum GetMapImageTextureTarget(cc::ContextProvider* context_provider) {
+ if (!context_provider)
+ return GL_TEXTURE_2D;
+
+ // TODO(reveman): Determine if GL_TEXTURE_EXTERNAL_OES works well on
+ // Android before we enable this. crbug.com/322780
+#if !defined(OS_ANDROID)
+ if (context_provider->ContextCapabilities().egl_image_external)
+ return GL_TEXTURE_EXTERNAL_OES;
+ if (context_provider->ContextCapabilities().texture_rectangle)
+ return GL_TEXTURE_RECTANGLE_ARB;
+#endif
+
+ return GL_TEXTURE_2D;
+}
+
} // namespace
namespace cc {
@@ -1660,7 +1677,8 @@ void LayerTreeHostImpl::CreateAndSetTileManager(
rendering_stats_instrumentation_,
using_map_image,
GetMaxTransferBufferUsageBytes(context_provider),
- GetMaxRasterTasksUsageBytes(context_provider));
+ GetMaxRasterTasksUsageBytes(context_provider),
+ GetMapImageTextureTarget(context_provider));
UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy());
need_to_update_visible_tiles_before_draw_ = false;
« no previous file with comments | « cc/test/fake_tile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698