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

Unified Diff: cc/layers/delegated_renderer_layer_impl.cc

Issue 1155553006: Revert of cc: Fix size_t to int truncations in layers/ output/ playback/ quads/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/layers/delegated_renderer_layer_impl.h ('k') | cc/layers/delegated_renderer_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/delegated_renderer_layer_impl.cc
diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc
index 2b7590e23ce5e458e96a6ecc73d9966442e42073..4532312dd1400604b9a36f1af1026bbb65008969 100644
--- a/cc/layers/delegated_renderer_layer_impl.cc
+++ b/cc/layers/delegated_renderer_layer_impl.cc
@@ -180,7 +180,7 @@
RenderPassList::iterator to_take =
render_passes_in_draw_order->begin() + i;
render_passes_index_by_id_.insert(
- RenderPassToIndexMap::value_type((*to_take)->id, i));
+ std::pair<RenderPassId, int>((*to_take)->id, i));
scoped_ptr<RenderPass> taken_render_pass =
render_passes_in_draw_order->take(to_take);
render_passes_in_draw_order_.push_back(taken_render_pass.Pass());
@@ -210,13 +210,8 @@
have_render_passes_to_push_ = false;
}
-static inline size_t IndexToId(size_t index) {
- return index + 1;
-}
-static inline size_t IdToIndex(size_t id) {
- DCHECK_GT(id, 0u);
- return id - 1;
-}
+static inline int IndexToId(int index) { return index + 1; }
+static inline int IdToIndex(int id) { return id - 1; }
RenderPassId DelegatedRendererLayerImpl::FirstContributingRenderPassId() const {
return RenderPassId(id(), IndexToId(0));
@@ -230,13 +225,13 @@
bool DelegatedRendererLayerImpl::ConvertDelegatedRenderPassId(
RenderPassId delegated_render_pass_id,
RenderPassId* output_render_pass_id) const {
- RenderPassToIndexMap::const_iterator found =
+ base::hash_map<RenderPassId, int>::const_iterator found =
render_passes_index_by_id_.find(delegated_render_pass_id);
if (found == render_passes_index_by_id_.end()) {
// Be robust against a RenderPass id that isn't part of the frame.
return false;
}
- size_t delegated_render_pass_index = found->second;
+ unsigned delegated_render_pass_index = found->second;
*output_render_pass_id =
RenderPassId(id(), IndexToId(delegated_render_pass_index));
return true;
@@ -254,7 +249,7 @@
inverse_device_scale_factor_);
for (size_t i = 0; i < render_passes_in_draw_order_.size() - 1; ++i) {
- RenderPassId output_render_pass_id;
+ RenderPassId output_render_pass_id(-1, -1);
bool present =
ConvertDelegatedRenderPassId(render_passes_in_draw_order_[i]->id,
&output_render_pass_id);
@@ -262,7 +257,7 @@
// Don't clash with the RenderPass we generate if we own a RenderSurface.
DCHECK(present) << render_passes_in_draw_order_[i]->id.layer_id << ", "
<< render_passes_in_draw_order_[i]->id.index;
- DCHECK_GT(output_render_pass_id.index, 0u);
+ DCHECK_GT(output_render_pass_id.index, 0);
scoped_ptr<RenderPass> copy_pass =
render_passes_in_draw_order_[i]->Copy(output_render_pass_id);
@@ -313,7 +308,7 @@
// Verify that the RenderPass we are appending to was created by us.
DCHECK(target_render_pass_id.layer_id == id());
- size_t render_pass_index = IdToIndex(target_render_pass_id.index);
+ int render_pass_index = IdToIndex(target_render_pass_id.index);
const RenderPass* delegated_render_pass =
render_passes_in_draw_order_[render_pass_index];
AppendRenderPassQuads(render_pass,
@@ -491,7 +486,7 @@
} else {
RenderPassId delegated_contributing_render_pass_id =
RenderPassDrawQuad::MaterialCast(delegated_quad)->render_pass_id;
- RenderPassId output_contributing_render_pass_id;
+ RenderPassId output_contributing_render_pass_id(-1, -1);
bool present =
ConvertDelegatedRenderPassId(delegated_contributing_render_pass_id,
« no previous file with comments | « cc/layers/delegated_renderer_layer_impl.h ('k') | cc/layers/delegated_renderer_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698