summaryrefslogtreecommitdiffstats
path: root/cc/surfaces/surface_aggregator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/surfaces/surface_aggregator.cc')
-rw-r--r--cc/surfaces/surface_aggregator.cc25
1 files changed, 11 insertions, 14 deletions
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index 588d624..f5689c5b 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());