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

Unified Diff: cc/surfaces/surface_factory.cc

Issue 509193002: Allow requesting a copy of a surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/surface_factory.h ('k') | content/browser/compositor/delegated_frame_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_factory.cc
diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
index 94f98fc7c374c40aaf0f347256a3e251dfd2f163..79bbe5eabd1cc762e8f836cccf02e7902f01e259 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -5,6 +5,7 @@
#include "cc/surfaces/surface_factory.h"
#include "cc/output/compositor_frame.h"
+#include "cc/output/copy_output_request.h"
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_manager.h"
#include "ui/gfx/geometry/size.h"
@@ -44,6 +45,18 @@ void SurfaceFactory::SubmitFrame(SurfaceId surface_id,
manager_->SurfaceModified(surface_id);
}
+void SurfaceFactory::RequestCopyOfSurface(
+ SurfaceId surface_id,
+ scoped_ptr<CopyOutputRequest> copy_request) {
+ OwningSurfaceMap::iterator it = surface_map_.find(surface_id);
+ if (it == surface_map_.end()) {
+ copy_request->SendEmptyResult();
+ return;
+ }
+ DCHECK(it->second->factory() == this);
+ it->second->RequestCopyOfOutput(copy_request.Pass());
+}
+
void SurfaceFactory::ReceiveFromChild(
const TransferableResourceArray& resources) {
holder_.ReceiveFromChild(resources);
« no previous file with comments | « cc/surfaces/surface_factory.h ('k') | content/browser/compositor/delegated_frame_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698