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

Unified Diff: components/bitmap_uploader/bitmap_uploader.cc

Issue 1976703003: Impl mus::mojom::GpuService to enable using Chrome IPC version gpu CmdBuf in mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build error Created 4 years, 7 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: components/bitmap_uploader/bitmap_uploader.cc
diff --git a/components/bitmap_uploader/bitmap_uploader.cc b/components/bitmap_uploader/bitmap_uploader.cc
index e34338aed1247c3a73aabebd230682b3da34631e..3e291af0abffb5cf3ed7ba2fe053c3306b4a65fc 100644
--- a/components/bitmap_uploader/bitmap_uploader.cc
+++ b/components/bitmap_uploader/bitmap_uploader.cc
@@ -14,7 +14,6 @@
#include "components/mus/public/cpp/surfaces/surfaces_utils.h"
#include "components/mus/public/cpp/window.h"
#include "components/mus/public/cpp/window_surface.h"
-#include "services/shell/public/cpp/connector.h"
namespace bitmap_uploader {
namespace {
@@ -43,12 +42,9 @@ void BitmapUploader::Init(shell::Connector* connector) {
surface_->BindToThread();
surface_->set_client(this);
- connector->ConnectToInterface("mojo:mus", &gpu_service_);
- mus::mojom::CommandBufferPtr command_buffer_ptr;
- gpu_service_->CreateOffscreenGLES2Context(GetProxy(&command_buffer_ptr));
- gles2_context_.reset(new mus::GLES2Context(std::vector<int32_t>(),
- std::move(command_buffer_ptr)));
- DCHECK(gles2_context_->Initialize());
+ gles2_context_ = mus::GLES2Context::CreateOffscreenContext(
+ std::vector<int32_t>(), connector);
+ DCHECK(gles2_context_);
}
// Sets the color which is RGBA.
@@ -74,11 +70,6 @@ void BitmapUploader::SetBitmap(int width,
}
void BitmapUploader::Upload() {
- // If the |gpu_service_| has errored than we won't get far. Do nothing,
- // assuming we are in shutdown.
- if (gpu_service_.encountered_error())
- return;
-
const gfx::Rect bounds(window_->bounds());
mus::mojom::PassPtr pass = mojo::CreateDefaultPass(1, bounds);
mus::mojom::CompositorFramePtr frame = mus::mojom::CompositorFrame::New();

Powered by Google App Engine
This is Rietveld 408576698