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

Unified Diff: content/browser/compositor/onscreen_display_client.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
Index: content/browser/compositor/onscreen_display_client.cc
diff --git a/content/browser/compositor/onscreen_display_client.cc b/content/browser/compositor/onscreen_display_client.cc
index a071a213a28c3b750be768eada7f6e694893b2d2..c814dff4617f80b2b86f13150120f5cc27fa13e4 100644
--- a/content/browser/compositor/onscreen_display_client.cc
+++ b/content/browser/compositor/onscreen_display_client.cc
@@ -14,12 +14,15 @@ namespace content {
OnscreenDisplayClient::OnscreenDisplayClient(
const scoped_refptr<cc::ContextProvider>& onscreen_context_provider,
scoped_ptr<cc::OutputSurface> software_surface,
- cc::SurfaceManager* manager)
+ cc::SurfaceManager* manager,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: onscreen_context_provider_(onscreen_context_provider),
software_surface_(software_surface.Pass()),
- display_(new cc::Display(this,
- manager,
- HostSharedBitmapManager::current())) {
+ display_(
+ new cc::Display(this, manager, HostSharedBitmapManager::current())),
+ task_runner_(task_runner),
+ scheduled_draw_(false),
+ weak_ptr_factory_(this) {
}
OnscreenDisplayClient::~OnscreenDisplayClient() {
@@ -32,4 +35,18 @@ scoped_ptr<cc::OutputSurface> OnscreenDisplayClient::CreateOutputSurface() {
.Pass();
}
+void OnscreenDisplayClient::DisplayDamaged() {
+ if (scheduled_draw_)
+ return;
+ scheduled_draw_ = true;
+ task_runner_->PostTask(
jamesr 2014/08/11 22:04:43 could you add some traces here and to ::Draw()? we
+ FROM_HERE,
+ base::Bind(&OnscreenDisplayClient::Draw, weak_ptr_factory_.GetWeakPtr()));
+}
+
+void OnscreenDisplayClient::Draw() {
+ scheduled_draw_ = false;
+ display_->Draw();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698