Chromium Code Reviews| Index: services/ui/demo/bitmap_uploader.cc |
| diff --git a/services/ui/demo/bitmap_uploader.cc b/services/ui/demo/bitmap_uploader.cc |
| index 204b952f54a4ec5da63713889e14ebd780034921..03550d2334c334aa6ba61ce3f70ce38668db7f12 100644 |
| --- a/services/ui/demo/bitmap_uploader.cc |
| +++ b/services/ui/demo/bitmap_uploader.cc |
| @@ -14,6 +14,7 @@ |
| #include "cc/quads/solid_color_draw_quad.h" |
| #include "cc/quads/texture_draw_quad.h" |
| #include "services/ui/public/cpp/gles2_context.h" |
| +#include "services/ui/public/cpp/gpu_service.h" |
| #include "services/ui/public/cpp/window.h" |
| #include "services/ui/public/cpp/window_surface.h" |
| @@ -29,25 +30,22 @@ const char kBitmapUploaderForAcceleratedWidget[] = |
| BitmapUploader::BitmapUploader(Window* window, GpuService* gpu_service) |
| : window_(window), |
| - gpu_service_(gpu_service), |
| color_(g_transparent_color), |
| width_(0), |
| height_(0), |
| format_(BGRA), |
| - next_resource_id_(1u) {} |
| - |
| -BitmapUploader::~BitmapUploader() { |
| -} |
| - |
| -void BitmapUploader::Init() { |
| + next_resource_id_(1u) { |
| surface_ = window_->RequestSurface(mojom::SurfaceType::DEFAULT); |
| surface_->BindToThread(); |
| surface_->set_client(this); |
| - gles2_context_ = GLES2Context::CreateOffscreenContext(gpu_service_); |
| + gles2_context_ = GLES2Context::CreateOffscreenContext( |
| + gpu_service->EstablishGpuChannelSync()); |
|
sky
2016/08/18 13:15:45
Aren't these all rather expensive calls? Seems lik
sadrul
2016/08/18 14:59:48
Done.
|
| // CreateOffscreenContext() may return null. |
|
sky
2016/08/18 13:15:45
Update or remove comment?
sadrul
2016/08/18 14:59:48
Done (removed)
|
| } |
| +BitmapUploader::~BitmapUploader() {} |
| + |
| // Sets the color which is RGBA. |
| void BitmapUploader::SetColor(uint32_t color) { |
| if (color_ == color) |