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

Side by Side Diff: cc/output/direct_renderer.cc

Issue 1963693003: Revert of Correctly handle damage involving filters in SurfaceAggregator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | cc/surfaces/surface_aggregator.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/output/direct_renderer.h" 5 #include "cc/output/direct_renderer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <utility> 10 #include <utility>
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } else { 271 } else {
272 DrawRenderPassAndExecuteCopyRequests(&frame, root_render_pass); 272 DrawRenderPassAndExecuteCopyRequests(&frame, root_render_pass);
273 } 273 }
274 274
275 FinishDrawingFrame(&frame); 275 FinishDrawingFrame(&frame);
276 render_passes_in_draw_order->clear(); 276 render_passes_in_draw_order->clear();
277 } 277 }
278 278
279 gfx::Rect DirectRenderer::ComputeScissorRectForRenderPass( 279 gfx::Rect DirectRenderer::ComputeScissorRectForRenderPass(
280 const DrawingFrame* frame) { 280 const DrawingFrame* frame) {
281 DCHECK(frame->current_render_pass->copy_requests.empty() || 281 gfx::Rect render_pass_scissor = frame->current_render_pass->output_rect;
282 (frame->current_render_pass->damage_rect == 282
283 frame->current_render_pass->output_rect)); 283 if (frame->root_damage_rect == frame->root_render_pass->output_rect ||
284 return frame->current_render_pass->damage_rect; 284 !frame->current_render_pass->copy_requests.empty())
285 return render_pass_scissor;
286
287 gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization);
288 if (frame->current_render_pass->transform_to_root_target.GetInverse(
289 &inverse_transform)) {
290 // Only intersect inverse-projected damage if the transform is invertible.
291 gfx::Rect damage_rect_in_render_pass_space =
292 MathUtil::ProjectEnclosingClippedRect(inverse_transform,
293 frame->root_damage_rect);
294 render_pass_scissor.Intersect(damage_rect_in_render_pass_space);
295 }
296
297 return render_pass_scissor;
285 } 298 }
286 299
287 bool DirectRenderer::NeedDeviceClip(const DrawingFrame* frame) const { 300 bool DirectRenderer::NeedDeviceClip(const DrawingFrame* frame) const {
288 if (frame->current_render_pass != frame->root_render_pass) 301 if (frame->current_render_pass != frame->root_render_pass)
289 return false; 302 return false;
290 303
291 return !frame->device_clip_rect.Contains(frame->device_viewport_rect); 304 return !frame->device_clip_rect.Contains(frame->device_viewport_rect);
292 } 305 }
293 306
294 gfx::Rect DirectRenderer::DeviceClipRectInDrawSpace( 307 gfx::Rect DirectRenderer::DeviceClipRectInDrawSpace(
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 auto iter = render_pass_textures_.find(id); 564 auto iter = render_pass_textures_.find(id);
552 return iter != render_pass_textures_.end() && iter->second->id(); 565 return iter != render_pass_textures_.end() && iter->second->id();
553 } 566 }
554 567
555 // static 568 // static
556 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { 569 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) {
557 return render_pass->output_rect.size(); 570 return render_pass->output_rect.size();
558 } 571 }
559 572
560 } // namespace cc 573 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface_aggregator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698