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

Unified Diff: cc/output/dc_layer_overlay.cc

Issue 2780073002: Disable DirectComposition underlays and complex transforms by default. (Closed)
Patch Set: fix tests Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/dc_layer_overlay.cc
diff --git a/cc/output/dc_layer_overlay.cc b/cc/output/dc_layer_overlay.cc
index 44baeeb62e74c6c2a7d481d45ea56c556877814b..b5d9f3c78d04444423fab5832ef4b44b58bfff46 100644
--- a/cc/output/dc_layer_overlay.cc
+++ b/cc/output/dc_layer_overlay.cc
@@ -10,6 +10,7 @@
#include "cc/resources/resource_provider.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "ui/gfx/geometry/rect_conversions.h"
+#include "ui/gl/gl_switches.h"
namespace cc {
@@ -120,12 +121,18 @@ void DCLayerOverlayProcessor::Process(ResourceProvider* resource_provider,
quad_list->begin(), it, &ca_layer);
if (result != DC_LAYER_SUCCESS)
continue;
+
+ if (!it->shared_quad_state->quad_to_target_transform
+ .Preserves2dAxisAlignment() &&
+ !base::FeatureList::IsEnabled(
+ features::kDirectCompositionComplexOverlays)) {
+ continue;
+ }
+
gfx::Rect quad_rectangle = MathUtil::MapEnclosingClippedRect(
it->shared_quad_state->quad_to_target_transform, it->rect);
gfx::RectF occlusion_bounding_box =
GetOcclusionBounds(gfx::RectF(quad_rectangle), quad_list->begin(), it);
- overlay_damage_rect->Union(quad_rectangle);
-
if (occlusion_bounding_box.IsEmpty()) {
// The quad is on top, so promote it to an overlay and remove all damage
// underneath it.
@@ -135,6 +142,9 @@ void DCLayerOverlayProcessor::Process(ResourceProvider* resource_provider,
damage_rect->Subtract(quad_rectangle);
}
quad_list->EraseAndInvalidateAllPointers(it);
+ } else if (!base::FeatureList::IsEnabled(
+ features::kDirectCompositionUnderlays)) {
+ continue;
} else {
// The quad is occluded, so replace it with a black solid color quad and
// place the overlay itself under the quad.
@@ -175,6 +185,7 @@ void DCLayerOverlayProcessor::Process(ResourceProvider* resource_provider,
previous_occlusion_bounding_box_ =
gfx::ToEnclosingRect(occlusion_bounding_box);
}
+ overlay_damage_rect->Union(quad_rectangle);
ca_layer_overlays->push_back(ca_layer);
// Only allow one overlay for now.
« no previous file with comments | « no previous file | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698