| Index: cc/output/gl_renderer.cc
|
| diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
|
| index 5d5afdf1b2edbcc668e8818cb7ddcdfe0cd748c9..89c2c75edb69423dfe574728572c3f5dc99b2c5f 100644
|
| --- a/cc/output/gl_renderer.cc
|
| +++ b/cc/output/gl_renderer.cc
|
| @@ -711,6 +711,8 @@ void GLRenderer::ApplyBlendModeUsingBlendFunc(SkBlendMode blend_mode) {
|
| // Left no-op intentionally.
|
| } else if (blend_mode == SkBlendMode::kDstIn) {
|
| gl_->BlendFunc(GL_ZERO, GL_SRC_ALPHA);
|
| + } else if (blend_mode == SkBlendMode::kDstOut) {
|
| + gl_->BlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
|
| } else if (blend_mode == SkBlendMode::kScreen) {
|
| gl_->BlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE);
|
| } else {
|
| @@ -776,6 +778,7 @@ void GLRenderer::RestoreBlendFuncToDefault(SkBlendMode blend_mode) {
|
| case SkBlendMode::kSrcOver:
|
| break;
|
| case SkBlendMode::kDstIn:
|
| + case SkBlendMode::kDstOut:
|
| case SkBlendMode::kScreen:
|
| gl_->BlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
| break;
|
| @@ -1734,7 +1737,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
|
|
| // Early out if alpha is small enough that quad doesn't contribute to output.
|
| if (alpha < std::numeric_limits<float>::epsilon() &&
|
| - quad->ShouldDrawWithBlending())
|
| + quad->ShouldDrawWithBlending() &&
|
| + quad->shared_quad_state->blend_mode == SkBlendMode::kSrcOver)
|
| return;
|
|
|
| gfx::Transform device_transform =
|
| @@ -1781,6 +1785,7 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
| // Enable blending when the quad properties require it or if we decided
|
| // to use antialiasing.
|
| SetBlendEnabled(quad->ShouldDrawWithBlending() || use_aa);
|
| + ApplyBlendModeUsingBlendFunc(quad->shared_quad_state->blend_mode);
|
|
|
| // Antialising requires a normalized quad, but this could lead to floating
|
| // point precision errors, so only normalize when antialising is on.
|
| @@ -1808,6 +1813,7 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
| quad->shared_quad_state->quad_to_target_transform);
|
| gl_->DrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
|
| }
|
| + RestoreBlendFuncToDefault(quad->shared_quad_state->blend_mode);
|
| }
|
|
|
| void GLRenderer::DrawTileQuad(const TileDrawQuad* quad,
|
|
|