summaryrefslogtreecommitdiffstats
path: root/cc/layers/delegated_renderer_layer_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/layers/delegated_renderer_layer_impl.cc')
-rw-r--r--cc/layers/delegated_renderer_layer_impl.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc
index 8158edcf..5d51116 100644
--- a/cc/layers/delegated_renderer_layer_impl.cc
+++ b/cc/layers/delegated_renderer_layer_impl.cc
@@ -109,7 +109,16 @@ void DelegatedRendererLayerImpl::SetFrameData(
bool invalid_frame = false;
ResourceProvider::ResourceIdSet resources_in_frame;
size_t reserve_size = frame_data->resource_list.size();
+#if defined(COMPILER_MSVC)
resources_in_frame.reserve(reserve_size);
+#elif defined(COMPILER_GCC)
+ // Pre-standard hash-tables only implement resize, which behaves similarly
+ // to reserve for these keys. Resizing to 0 may also be broken (particularly
+ // on stlport).
+ // TODO(jbauman): Replace with reserve when C++11 is supported everywhere.
+ if (reserve_size)
+ resources_in_frame.resize(reserve_size);
+#endif
for (const auto& pass : render_pass_list) {
for (const auto& quad : pass->quad_list) {
for (ResourceId& resource_id : quad->resources) {