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

Side by Side Diff: content/renderer/android/synchronous_compositor_frame_sink.cc

Issue 2543473004: cc: Move filters from RenderPassDrawQuad to RenderPass (Closed)
Patch Set: Address review comments Created 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/android/synchronous_compositor_frame_sink.h" 5 #include "content/renderer/android/synchronous_compositor_frame_sink.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // Make a root frame that embeds the frame coming from the layer compositor 265 // Make a root frame that embeds the frame coming from the layer compositor
266 // and positions it based on the provided viewport. 266 // and positions it based on the provided viewport.
267 // TODO(danakj): We could apply the transform here instead of passing it to 267 // TODO(danakj): We could apply the transform here instead of passing it to
268 // the CompositorFrameSink client too? (We'd have to do the same for 268 // the CompositorFrameSink client too? (We'd have to do the same for
269 // hardware frames in SurfacesInstance?) 269 // hardware frames in SurfacesInstance?)
270 cc::CompositorFrame embed_frame; 270 cc::CompositorFrame embed_frame;
271 embed_frame.render_pass_list.push_back(cc::RenderPass::Create()); 271 embed_frame.render_pass_list.push_back(cc::RenderPass::Create());
272 272
273 // The embedding RenderPass covers the entire Display's area. 273 // The embedding RenderPass covers the entire Display's area.
274 const auto& embed_render_pass = embed_frame.render_pass_list.back(); 274 const auto& embed_render_pass = embed_frame.render_pass_list.back();
275 embed_render_pass->SetAll(cc::RenderPassId(1, 1), gfx::Rect(display_size), 275 embed_render_pass->SetNew(cc::RenderPassId(1, 1), gfx::Rect(display_size),
276 gfx::Rect(display_size), gfx::Transform(), false); 276 gfx::Rect(display_size), gfx::Transform());
277 embed_render_pass->has_transparent_background = false;
277 278
278 // The RenderPass has a single SurfaceDrawQuad (and SharedQuadState for it). 279 // The RenderPass has a single SurfaceDrawQuad (and SharedQuadState for it).
279 auto* shared_quad_state = 280 auto* shared_quad_state =
280 embed_render_pass->CreateAndAppendSharedQuadState(); 281 embed_render_pass->CreateAndAppendSharedQuadState();
281 auto* surface_quad = 282 auto* surface_quad =
282 embed_render_pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); 283 embed_render_pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>();
283 shared_quad_state->SetAll( 284 shared_quad_state->SetAll(
284 child_transform, child_size, gfx::Rect(child_size), 285 child_transform, child_size, gfx::Rect(child_size),
285 gfx::Rect() /* clip_rect */, false /* is_clipped */, 1.f /* opacity */, 286 gfx::Rect() /* clip_rect */, false /* is_clipped */, 1.f /* opacity */,
286 SkBlendMode::kSrcOver, 0 /* sorting_context_id */); 287 SkBlendMode::kSrcOver, 0 /* sorting_context_id */);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 client_->ReclaimResources(resources); 463 client_->ReclaimResources(resources);
463 } 464 }
464 465
465 void SynchronousCompositorFrameSink::SetBeginFrameSource( 466 void SynchronousCompositorFrameSink::SetBeginFrameSource(
466 cc::BeginFrameSource* begin_frame_source) { 467 cc::BeginFrameSource* begin_frame_source) {
467 // Software output is synchronous and doesn't use a BeginFrameSource. 468 // Software output is synchronous and doesn't use a BeginFrameSource.
468 NOTREACHED(); 469 NOTREACHED();
469 } 470 }
470 471
471 } // namespace content 472 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698