Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/surfaces/surface_aggregator.h" | 5 #include "cc/surfaces/surface_aggregator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/containers/adapters.h" | 12 #include "base/containers/adapters.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "base/metrics/histogram_macros.h" | 16 #include "base/metrics/histogram_macros.h" |
| 17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
| 18 #include "base/trace_event/trace_event.h" | 18 #include "base/trace_event/trace_event.h" |
| 19 #include "cc/base/math_util.h" | 19 #include "cc/base/math_util.h" |
| 20 #include "cc/output/compositor_frame.h" | 20 #include "cc/output/compositor_frame.h" |
| 21 #include "cc/quads/draw_quad.h" | 21 #include "cc/quads/draw_quad.h" |
| 22 #include "cc/quads/render_pass_draw_quad.h" | 22 #include "cc/quads/render_pass_draw_quad.h" |
| 23 #include "cc/quads/shared_quad_state.h" | 23 #include "cc/quads/shared_quad_state.h" |
| 24 #include "cc/quads/solid_color_draw_quad.h" | 24 #include "cc/quads/solid_color_draw_quad.h" |
| 25 #include "cc/quads/surface_draw_quad.h" | 25 #include "cc/quads/surface_draw_quad.h" |
| 26 #include "cc/quads/texture_draw_quad.h" | 26 #include "cc/quads/texture_draw_quad.h" |
| 27 #include "cc/resources/resource_provider.h" | 27 #include "cc/resources/resource_provider.h" |
| 28 #include "cc/surfaces/surface.h" | 28 #include "cc/surfaces/surface.h" |
| 29 #include "cc/surfaces/surface_factory.h" | 29 #include "cc/surfaces/surface_factory.h" |
|
Fady Samuel
2017/04/20 12:45:48
Is this still necessary?
Alex Z.
2017/04/20 13:58:05
Done.
| |
| 30 #include "cc/surfaces/surface_manager.h" | 30 #include "cc/surfaces/surface_manager.h" |
| 31 #include "cc/trees/blocking_task_runner.h" | 31 #include "cc/trees/blocking_task_runner.h" |
| 32 | 32 |
| 33 namespace cc { | 33 namespace cc { |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 // Maximum bucket size for the UMA stats. | 36 // Maximum bucket size for the UMA stats. |
| 37 constexpr int kUmaStatMaxSurfaces = 30; | 37 constexpr int kUmaStatMaxSurfaces = 30; |
| 38 | 38 |
| 39 const char kUmaValidSurface[] = | 39 const char kUmaValidSurface[] = |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 752 | 752 |
| 753 CHECK(debug_weak_this.get()); | 753 CHECK(debug_weak_this.get()); |
| 754 for (const auto& surface_id : frame.metadata.referenced_surfaces) { | 754 for (const auto& surface_id : frame.metadata.referenced_surfaces) { |
| 755 if (!contained_surfaces_.count(surface_id)) { | 755 if (!contained_surfaces_.count(surface_id)) { |
| 756 result->undrawn_surfaces.insert(surface_id); | 756 result->undrawn_surfaces.insert(surface_id); |
| 757 PrewalkTree(surface_id, false, 0, result); | 757 PrewalkTree(surface_id, false, 0, result); |
| 758 } | 758 } |
| 759 } | 759 } |
| 760 | 760 |
| 761 CHECK(debug_weak_this.get()); | 761 CHECK(debug_weak_this.get()); |
| 762 if (surface->factory()) { | 762 if (!damage_rect.IsEmpty()) |
|
danakj
2017/04/20 13:56:45
Can you leave a TODO that this shouldn't need to c
Alex Z.
2017/04/20 14:05:03
Done.
| |
| 763 surface->factory()->WillDrawSurface( | 763 surface->RunWillDrawCallbacks(damage_rect); |
|
danakj
2017/04/20 13:56:45
Also, DelegatedFrameHost doesn't need to check for
Alex Z.
2017/04/20 14:05:03
Done. Does DFH need to check the local surface id?
danakj
2017/04/20 14:18:43
I'm not sure, you could look at when each is set t
Alex Z.
2017/04/20 17:42:26
DelegatedFrameHost updates local_surface_id_ in
S
| |
| 764 surface->surface_id().local_surface_id(), damage_rect); | |
| 765 } | |
| 766 | 764 |
| 767 CHECK(debug_weak_this.get()); | 765 CHECK(debug_weak_this.get()); |
| 768 for (const auto& render_pass : frame.render_pass_list) { | 766 for (const auto& render_pass : frame.render_pass_list) { |
| 769 if (!render_pass->copy_requests.empty()) { | 767 if (!render_pass->copy_requests.empty()) { |
| 770 int remapped_pass_id = RemapPassId(render_pass->id, surface_id); | 768 int remapped_pass_id = RemapPassId(render_pass->id, surface_id); |
| 771 copy_request_passes_.insert(remapped_pass_id); | 769 copy_request_passes_.insert(remapped_pass_id); |
| 772 } | 770 } |
| 773 } | 771 } |
| 774 | 772 |
| 775 referenced_surfaces_.erase(referenced_surfaces_.find(surface->surface_id())); | 773 referenced_surfaces_.erase(referenced_surfaces_.find(surface->surface_id())); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 932 } | 930 } |
| 933 | 931 |
| 934 void SurfaceAggregator::SetOutputColorSpace( | 932 void SurfaceAggregator::SetOutputColorSpace( |
| 935 const gfx::ColorSpace& blending_color_space, | 933 const gfx::ColorSpace& blending_color_space, |
| 936 const gfx::ColorSpace& output_color_space) { | 934 const gfx::ColorSpace& output_color_space) { |
| 937 blending_color_space_ = blending_color_space; | 935 blending_color_space_ = blending_color_space; |
| 938 output_color_space_ = output_color_space; | 936 output_color_space_ = output_color_space; |
| 939 } | 937 } |
| 940 | 938 |
| 941 } // namespace cc | 939 } // namespace cc |
| OLD | NEW |