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

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..1f5859d025380af06066969d2fe389dba200ec3f 100644
--- a/content/browser/compositor/onscreen_display_client.cc
+++ b/content/browser/compositor/onscreen_display_client.cc
@@ -4,6 +4,7 @@
#include "content/browser/compositor/onscreen_display_client.h"
+#include "base/debug/trace_event.h"
#include "cc/output/output_surface.h"
#include "cc/surfaces/surface_factory.h"
#include "cc/surfaces/surface_manager.h"
@@ -14,12 +15,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 +36,20 @@ scoped_ptr<cc::OutputSurface> OnscreenDisplayClient::CreateOutputSurface() {
.Pass();
}
+void OnscreenDisplayClient::DisplayDamaged() {
+ if (scheduled_draw_)
+ return;
+ TRACE_EVENT0("content", "OnscreenDisplayClient::DisplayDamaged");
+ scheduled_draw_ = true;
+ task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&OnscreenDisplayClient::Draw, weak_ptr_factory_.GetWeakPtr()));
+}
+
+void OnscreenDisplayClient::Draw() {
+ TRACE_EVENT0("content", "OnscreenDisplayClient::Draw");
+ scheduled_draw_ = false;
+ display_->Draw();
+}
+
} // namespace content
« no previous file with comments | « content/browser/compositor/onscreen_display_client.h ('k') | content/browser/compositor/surface_display_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698