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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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/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 588d624b4a12851e77e83384ed8028a226f58a9b..f5689c5b4cb4ace1f4afb2bb4d85f4d91e3e6f10 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -163,6 +163,7 @@ gfx::Rect SurfaceAggregator::DamageRectForSurface(const Surface* surface,
}
void SurfaceAggregator::HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad,
+ float opacity,
RenderPass* dest_pass) {
SurfaceId surface_id = surface_quad->surface_id;
// If this surface's id is already in our referenced set then it creates
@@ -227,11 +228,8 @@ void SurfaceAggregator::HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad,
copy_pass->transform_to_root_target.ConcatTransform(
surface_quad->quadTransform());
- CopyQuadsToPass(source.quad_list,
- source.shared_quad_state_list,
- gfx::Transform(),
- copy_pass.get(),
- surface_id);
+ CopyQuadsToPass(source.quad_list, source.shared_quad_state_list,
+ gfx::Transform(), 1.f, copy_pass.get(), surface_id);
dest_pass_list_->push_back(copy_pass.Pass());
}
@@ -242,17 +240,16 @@ void SurfaceAggregator::HandleSurfaceQuad(const SurfaceDrawQuad* surface_quad,
const QuadList& quads = last_pass.quad_list;
// TODO(jamesr): Make sure clipping is enforced.
- CopyQuadsToPass(quads,
- last_pass.shared_quad_state_list,
+ CopyQuadsToPass(quads, last_pass.shared_quad_state_list,
surface_quad->quadTransform(),
- dest_pass,
- surface_id);
+ surface_quad->opacity() * opacity, dest_pass, surface_id);
} else {
RenderPassId remapped_pass_id = RemapPassId(last_pass.id, surface_id);
SharedQuadState* shared_quad_state =
dest_pass->CreateAndAppendSharedQuadState();
shared_quad_state->CopyFrom(surface_quad->shared_quad_state);
+ shared_quad_state->opacity *= opacity;
RenderPassDrawQuad* quad =
dest_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
quad->SetNew(shared_quad_state,
@@ -300,6 +297,7 @@ void SurfaceAggregator::CopyQuadsToPass(
const QuadList& source_quad_list,
const SharedQuadStateList& source_shared_quad_state_list,
const gfx::Transform& content_to_target_transform,
+ float opacity,
RenderPass* dest_pass,
SurfaceId surface_id) {
const SharedQuadState* last_copied_source_shared_quad_state = NULL;
@@ -315,11 +313,12 @@ void SurfaceAggregator::CopyQuadsToPass(
if (quad->material == DrawQuad::SURFACE_CONTENT) {
const SurfaceDrawQuad* surface_quad = SurfaceDrawQuad::MaterialCast(quad);
- HandleSurfaceQuad(surface_quad, dest_pass);
+ HandleSurfaceQuad(surface_quad, opacity, dest_pass);
} else {
if (quad->shared_quad_state != last_copied_source_shared_quad_state) {
CopySharedQuadState(
quad->shared_quad_state, content_to_target_transform, dest_pass);
+ dest_pass->shared_quad_state_list.back()->opacity *= opacity;
last_copied_source_shared_quad_state = quad->shared_quad_state;
}
if (quad->material == DrawQuad::RENDER_PASS) {
@@ -371,10 +370,8 @@ void SurfaceAggregator::CopyPasses(const DelegatedFrameData* frame_data,
source.transform_to_root_target,
source.has_transparent_background);
- CopyQuadsToPass(source.quad_list,
- source.shared_quad_state_list,
- gfx::Transform(),
- copy_pass.get(),
+ CopyQuadsToPass(source.quad_list, source.shared_quad_state_list,
+ gfx::Transform(), 1.f, copy_pass.get(),
surface->surface_id());
dest_pass_list_->push_back(copy_pass.Pass());
« 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