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

Unified Diff: mojo/cc/output_surface_mojo.cc

Issue 869343004: Remove use of mojo.SurfacesService interface in html_viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « mojo/cc/output_surface_mojo.h ('k') | mojo/services/html_viewer/html_document.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/cc/output_surface_mojo.cc
diff --git a/mojo/cc/output_surface_mojo.cc b/mojo/cc/output_surface_mojo.cc
index 8a979e4707e52c993400444a7fb47d627c8f08c3..fff13806450aed4fe22e1f96bcf77bec6652f046 100644
--- a/mojo/cc/output_surface_mojo.cc
+++ b/mojo/cc/output_surface_mojo.cc
@@ -14,12 +14,11 @@ namespace mojo {
OutputSurfaceMojo::OutputSurfaceMojo(
OutputSurfaceMojoClient* client,
const scoped_refptr<cc::ContextProvider>& context_provider,
- SurfacePtr surface,
- uint32_t id_namespace)
+ SurfacePtr surface)
: cc::OutputSurface(context_provider),
output_surface_mojo_client_(client),
surface_(surface.Pass()),
- id_namespace_(id_namespace),
+ id_namespace_(0u),
local_id_(0u) {
capabilities_.delegated_rendering = true;
capabilities_.max_frames_pending = 1;
@@ -30,6 +29,11 @@ OutputSurfaceMojo::~OutputSurfaceMojo() {
void OutputSurfaceMojo::SetIdNamespace(uint32_t id_namespace) {
id_namespace_ = id_namespace;
+ if (local_id_) {
+ cc::SurfaceId qualified_id(static_cast<uint64_t>(id_namespace_) << 32 |
+ local_id_);
+ output_surface_mojo_client_->DidCreateSurface(qualified_id);
+ }
}
void OutputSurfaceMojo::ReturnResources(Array<ReturnedResourcePtr> resources) {
@@ -49,9 +53,11 @@ void OutputSurfaceMojo::SwapBuffers(cc::CompositorFrame* frame) {
}
local_id_++;
surface_->CreateSurface(local_id_);
- cc::SurfaceId qualified_id(static_cast<uint64_t>(id_namespace_) << 32 |
- local_id_);
- output_surface_mojo_client_->DidCreateSurface(qualified_id);
+ if (id_namespace_) {
+ cc::SurfaceId qualified_id(static_cast<uint64_t>(id_namespace_) << 32 |
+ local_id_);
+ output_surface_mojo_client_->DidCreateSurface(qualified_id);
+ }
surface_size_ = frame_size;
}
« no previous file with comments | « mojo/cc/output_surface_mojo.h ('k') | mojo/services/html_viewer/html_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698