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

Unified Diff: cc/layers/delegated_renderer_layer.cc

Issue 23455060: mix-blend-mode implementation for accelerated layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unittests fixed Created 7 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/layers/compositing_reasons.h ('k') | cc/layers/delegated_renderer_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/delegated_renderer_layer.cc
diff --git a/cc/layers/delegated_renderer_layer.cc b/cc/layers/delegated_renderer_layer.cc
index a92b70106deefab1a3b5872cda4204442a24b8f2..a940903b966d2fe87ca786fc819ea525593e7803 100644
--- a/cc/layers/delegated_renderer_layer.cc
+++ b/cc/layers/delegated_renderer_layer.cc
@@ -107,10 +107,13 @@ void DelegatedRendererLayer::SetDisplaySize(gfx::Size size) {
SetNeedsCommit();
}
-static bool FrameDataHasFilter(DelegatedFrameData* frame) {
+static bool FrameDataRequiresFilterContext(const DelegatedFrameData* frame) {
for (size_t i = 0; i < frame->render_pass_list.size(); ++i) {
const QuadList& quad_list = frame->render_pass_list[i]->quad_list;
for (size_t j = 0; j < quad_list.size(); ++j) {
+ if (quad_list[j]->shared_quad_state->blend_mode !=
+ SkXfermode::kSrcOver_Mode)
+ return true;
if (quad_list[j]->material != DrawQuad::RENDER_PASS)
continue;
const RenderPassDrawQuad* render_pass_quad =
@@ -133,9 +136,9 @@ bool DelegatedRendererLayer::Update(ResourceUpdateQueue* queue,
frame_provider_->GetFrameDataAndRefResources(this, &frame_damage_);
should_collect_new_frame_ = false;
- // If any quad has a filter operation, then we need a filter context to draw
- // this layer's content.
- if (FrameDataHasFilter(frame_data_) && layer_tree_host())
+ // If any quad has a filter operation or a blend mode other than normal,
+ // then we need an offscreen context to draw this layer's content.
+ if (FrameDataRequiresFilterContext(frame_data_))
layer_tree_host()->set_needs_filter_context();
return true;
« no previous file with comments | « cc/layers/compositing_reasons.h ('k') | cc/layers/delegated_renderer_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698