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

Unified Diff: cc/surfaces/display.cc

Issue 432093003: Enqueuing new frames in a Surface should cause Displays to reaggregate it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « cc/surfaces/display.h ('k') | cc/surfaces/display_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display.cc
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc
index b9929ba370c505379597580d50c4b74506fc669a..df64a6c908cb60ef785802ca3ca61ea73f17e647 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -14,6 +14,7 @@
#include "cc/surfaces/display_client.h"
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_aggregator.h"
+#include "cc/surfaces/surface_manager.h"
namespace cc {
@@ -21,14 +22,17 @@ Display::Display(DisplayClient* client,
SurfaceManager* manager,
SharedBitmapManager* bitmap_manager)
: client_(client), manager_(manager), bitmap_manager_(bitmap_manager) {
+ manager_->AddObserver(this);
}
Display::~Display() {
+ manager_->RemoveObserver(this);
}
void Display::Resize(SurfaceId id, const gfx::Size& size) {
current_surface_id_ = id;
current_surface_size_ = size;
+ client_->DisplayDamaged();
}
void Display::InitializeOutputSurface() {
@@ -85,8 +89,10 @@ bool Display::Draw() {
if (!output_surface_)
return false;
+ contained_surfaces_.clear();
+
scoped_ptr<CompositorFrame> frame =
- aggregator_->Aggregate(current_surface_id_);
+ aggregator_->Aggregate(current_surface_id_, &contained_surfaces_);
if (!frame)
return false;
@@ -113,6 +119,11 @@ bool Display::Draw() {
return true;
}
+void Display::OnSurfaceDamaged(SurfaceId surface) {
+ if (contained_surfaces_.find(surface) != contained_surfaces_.end())
+ client_->DisplayDamaged();
+}
+
SurfaceId Display::CurrentSurfaceId() {
return current_surface_id_;
}
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/display_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698