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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 404563005: Make RenderPass::Id an isolated class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more case in mojo Created 6 years, 4 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/surfaces/surface_aggregator.h ('k') | cc/surfaces/surface_aggregator_test_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator.cc
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index af2bc9c2d43946ae1d789b2a6993f70ccc74cf7f..f9ef03680ac1fd766cd6b96d7689ca2ad2518131 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -35,28 +35,27 @@ class SurfaceAggregator::RenderPassIdAllocator {
: surface_id_(surface_id), next_index_(1) {}
~RenderPassIdAllocator() {}
- void AddKnownPass(RenderPass::Id id) {
+ void AddKnownPass(RenderPassId id) {
if (id_to_index_map_.find(id) != id_to_index_map_.end())
return;
id_to_index_map_[id] = next_index_++;
}
- RenderPass::Id Remap(RenderPass::Id id) {
+ RenderPassId Remap(RenderPassId id) {
DCHECK(id_to_index_map_.find(id) != id_to_index_map_.end());
- return RenderPass::Id(surface_id_.id, id_to_index_map_[id]);
+ return RenderPassId(surface_id_.id, id_to_index_map_[id]);
}
private:
- base::hash_map<RenderPass::Id, int> id_to_index_map_;
+ base::hash_map<RenderPassId, int> id_to_index_map_;
SurfaceId surface_id_;
int next_index_;
DISALLOW_COPY_AND_ASSIGN(RenderPassIdAllocator);
};
-RenderPass::Id SurfaceAggregator::RemapPassId(
- RenderPass::Id surface_local_pass_id,
- SurfaceId surface_id) {
+RenderPassId SurfaceAggregator::RemapPassId(RenderPassId surface_local_pass_id,
+ SurfaceId surface_id) {
RenderPassIdAllocator* allocator = render_pass_allocator_map_.get(surface_id);
if (!allocator) {
allocator = new RenderPassIdAllocator(surface_id);
@@ -164,7 +163,7 @@ void SurfaceAggregator::HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad,
scoped_ptr<RenderPass> copy_pass(RenderPass::Create());
- RenderPass::Id remapped_pass_id = RemapPassId(source.id, surface_id);
+ RenderPassId remapped_pass_id = RemapPassId(source.id, surface_id);
copy_pass->SetAll(remapped_pass_id,
source.output_rect,
@@ -252,8 +251,8 @@ void SurfaceAggregator::CopyQuadsToPass(
if (quad->material == DrawQuad::RENDER_PASS) {
const RenderPassDrawQuad* pass_quad =
RenderPassDrawQuad::MaterialCast(quad);
- RenderPass::Id original_pass_id = pass_quad->render_pass_id;
- RenderPass::Id remapped_pass_id =
+ RenderPassId original_pass_id = pass_quad->render_pass_id;
+ RenderPassId remapped_pass_id =
RemapPassId(original_pass_id, surface_id);
dest_pass->CopyFromAndAppendRenderPassDrawQuad(
@@ -275,7 +274,7 @@ void SurfaceAggregator::CopyPasses(const RenderPassList& source_pass_list,
scoped_ptr<RenderPass> copy_pass(RenderPass::Create());
- RenderPass::Id remapped_pass_id = RemapPassId(source.id, surface_id);
+ RenderPassId remapped_pass_id = RemapPassId(source.id, surface_id);
copy_pass->SetAll(remapped_pass_id,
source.output_rect,
« no previous file with comments | « cc/surfaces/surface_aggregator.h ('k') | cc/surfaces/surface_aggregator_test_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698