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

Unified Diff: services/ui/public/cpp/bitmap_uploader.h

Issue 2247023002: services/ui: Move BitmapUploader into mus_demo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rm-software-output-device-mus
Patch Set: Created 4 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 | « services/ui/public/cpp/BUILD.gn ('k') | services/ui/public/cpp/bitmap_uploader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/public/cpp/bitmap_uploader.h
diff --git a/services/ui/public/cpp/bitmap_uploader.h b/services/ui/public/cpp/bitmap_uploader.h
deleted file mode 100644
index ca65951589d94b6ba45f58fd680572f6de67c3f0..0000000000000000000000000000000000000000
--- a/services/ui/public/cpp/bitmap_uploader.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SERVICES_UI_PUBLIC_CPP_BITMAP_UPLOADER_H_
-#define SERVICES_UI_PUBLIC_CPP_BITMAP_UPLOADER_H_
-
-#include <stdint.h>
-
-#include <memory>
-
-#include "base/compiler_specific.h"
-#include "base/containers/hash_tables.h"
-#include "base/macros.h"
-#include "gpu/GLES2/gl2chromium.h"
-#include "gpu/GLES2/gl2extchromium.h"
-#include "services/ui/public/cpp/window_surface.h"
-#include "services/ui/public/cpp/window_surface_client.h"
-#include "services/ui/public/interfaces/surface.mojom.h"
-
-namespace ui {
-class GLES2Context;
-class GpuService;
-
-extern const char kBitmapUploaderForAcceleratedWidget[];
-
-// BitmapUploader is useful if you want to draw a bitmap or color in a
-// Window.
-class BitmapUploader : public WindowSurfaceClient {
- public:
- BitmapUploader(Window* window, GpuService* gpu_service);
- ~BitmapUploader() override;
-
- void Init();
-
- // Sets the color which is RGBA.
- void SetColor(uint32_t color);
-
- enum Format {
- RGBA, // Pixel layout on Android.
- BGRA, // Pixel layout everywhere else.
- };
-
- // Sets a bitmap.
- void SetBitmap(int width,
- int height,
- std::unique_ptr<std::vector<unsigned char>> data,
- Format format);
-
- private:
- void Upload();
-
- uint32_t BindTextureForSize(const gfx::Size& size);
-
- uint32_t TextureFormat() const {
- return format_ == BGRA ? GL_BGRA_EXT : GL_RGBA;
- }
-
- void SetIdNamespace(uint32_t id_namespace);
-
- // WindowSurfaceClient implementation.
- void OnResourcesReturned(
- WindowSurface* surface,
- mojo::Array<cc::ReturnedResource> resources) override;
-
- Window* window_;
- std::unique_ptr<WindowSurface> surface_;
- // This may be null if there is an error contacting mus/initializing. We
- // assume we'll be shutting down soon and do nothing in this case.
- std::unique_ptr<GLES2Context> gles2_context_;
- GpuService* gpu_service_;
-
- uint32_t color_;
- int width_;
- int height_;
- Format format_;
- std::unique_ptr<std::vector<unsigned char>> bitmap_;
- uint32_t next_resource_id_;
- base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_;
-
- DISALLOW_COPY_AND_ASSIGN(BitmapUploader);
-};
-
-} // namespace ui
-
-#endif // SERVICES_UI_PUBLIC_CPP_BITMAP_UPLOADER_H_
« no previous file with comments | « services/ui/public/cpp/BUILD.gn ('k') | services/ui/public/cpp/bitmap_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698