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

Side by Side Diff: cc/layers/delegated_renderer_layer.cc

Issue 251343002: Remove offscreen compositor contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-offscreencontext: include Created 6 years, 8 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layers/layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/layers/delegated_renderer_layer.h" 5 #include "cc/layers/delegated_renderer_layer.h"
6 6
7 #include "cc/layers/delegated_renderer_layer_impl.h" 7 #include "cc/layers/delegated_renderer_layer_impl.h"
8 #include "cc/output/delegated_frame_data.h" 8 #include "cc/output/delegated_frame_data.h"
9 #include "cc/quads/render_pass_draw_quad.h" 9 #include "cc/quads/render_pass_draw_quad.h"
10 #include "cc/trees/blocking_task_runner.h" 10 #include "cc/trees/blocking_task_runner.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 SetNextCommitWaitsForActivation(); 86 SetNextCommitWaitsForActivation();
87 } 87 }
88 88
89 void DelegatedRendererLayer::SetDisplaySize(const gfx::Size& size) { 89 void DelegatedRendererLayer::SetDisplaySize(const gfx::Size& size) {
90 if (display_size_ == size) 90 if (display_size_ == size)
91 return; 91 return;
92 display_size_ = size; 92 display_size_ = size;
93 SetNeedsCommit(); 93 SetNeedsCommit();
94 } 94 }
95 95
96 static bool FrameDataRequiresFilterContext(const DelegatedFrameData* frame) {
97 for (size_t i = 0; i < frame->render_pass_list.size(); ++i) {
98 const QuadList& quad_list = frame->render_pass_list[i]->quad_list;
99 for (size_t j = 0; j < quad_list.size(); ++j) {
100 if (quad_list[j]->shared_quad_state->blend_mode !=
101 SkXfermode::kSrcOver_Mode)
102 return true;
103 if (quad_list[j]->material != DrawQuad::RENDER_PASS)
104 continue;
105 const RenderPassDrawQuad* render_pass_quad =
106 RenderPassDrawQuad::MaterialCast(quad_list[j]);
107 if (!render_pass_quad->filters.IsEmpty() ||
108 !render_pass_quad->background_filters.IsEmpty())
109 return true;
110 }
111 }
112 return false;
113 }
114
115 bool DelegatedRendererLayer::Update(ResourceUpdateQueue* queue, 96 bool DelegatedRendererLayer::Update(ResourceUpdateQueue* queue,
116 const OcclusionTracker<Layer>* occlusion) { 97 const OcclusionTracker<Layer>* occlusion) {
117 bool updated = Layer::Update(queue, occlusion); 98 bool updated = Layer::Update(queue, occlusion);
118 if (!should_collect_new_frame_) 99 if (!should_collect_new_frame_)
119 return updated; 100 return updated;
120 101
121 frame_data_ = 102 frame_data_ =
122 frame_provider_->GetFrameDataAndRefResources(this, &frame_damage_); 103 frame_provider_->GetFrameDataAndRefResources(this, &frame_damage_);
123 should_collect_new_frame_ = false; 104 should_collect_new_frame_ = false;
124 105
125 // If any quad has a filter operation or a blend mode other than normal,
126 // then we need an offscreen context to draw this layer's content.
127 if (FrameDataRequiresFilterContext(frame_data_))
128 layer_tree_host()->set_needs_filter_context();
129
130 SetNeedsPushProperties(); 106 SetNeedsPushProperties();
131 return true; 107 return true;
132 } 108 }
133 109
134 } // namespace cc 110 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698