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

Unified Diff: cc/output/overlay_processor.cc

Issue 1430813002: cc: Fork OverlayCandidate to CALayerOverlay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master1
Patch Set: Rebase Created 5 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/output/overlay_processor.h ('k') | cc/output/overlay_strategy_all_or_nothing.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/overlay_processor.cc
diff --git a/cc/output/overlay_processor.cc b/cc/output/overlay_processor.cc
index a97623a4c2fa4917e36ea62440a6a6dd0dda4f4a..2eea63b3d602603c808c4c81513a22984964b034 100644
--- a/cc/output/overlay_processor.cc
+++ b/cc/output/overlay_processor.cc
@@ -7,6 +7,7 @@
#include "cc/output/output_surface.h"
#include "cc/output/overlay_strategy_single_on_top.h"
#include "cc/output/overlay_strategy_underlay.h"
+#include "cc/quads/draw_quad.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/transform.h"
@@ -25,6 +26,31 @@ void OverlayProcessor::Initialize() {
OverlayProcessor::~OverlayProcessor() {}
+bool OverlayProcessor::ProcessForCALayers(
+ ResourceProvider* resource_provider,
+ RenderPassList* render_passes,
+ CALayerOverlayList* ca_layer_overlays,
+ OverlayCandidateList* overlay_candidates) {
+ RenderPass* root_render_pass = render_passes->back();
+
+ OverlayCandidateValidator* overlay_validator =
+ surface_->GetOverlayCandidateValidator();
+ if (!overlay_validator || !overlay_validator->AllowCALayerOverlays())
+ return false;
+
+ if (!ProcessForCALayerOverlays(
+ resource_provider, gfx::RectF(root_render_pass->output_rect),
+ root_render_pass->quad_list, ca_layer_overlays))
+ return false;
+
+ // CALayer overlays are all-or-nothing. If all quads were replaced with
+ // layers then clear the list and remove the backbuffer from the overcandidate
+ // list.
+ overlay_candidates->clear();
+ render_passes->back()->quad_list.clear();
+ return true;
+}
+
void OverlayProcessor::ProcessForOverlays(ResourceProvider* resource_provider,
RenderPassList* render_passes,
OverlayCandidateList* candidates,
« no previous file with comments | « cc/output/overlay_processor.h ('k') | cc/output/overlay_strategy_all_or_nothing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698