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

Unified Diff: chromecast/graphics/osd_plane_default.cc

Issue 1104853002: Adds public API and loads Cast OSD plane implementation from shared lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some nits Created 5 years, 8 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 | « chromecast/chromecast.gyp ('k') | chromecast/public/cast_egl_platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/graphics/osd_plane_default.cc
diff --git a/chromecast/graphics/osd_plane_default.cc b/chromecast/graphics/osd_plane_default.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2c73edc531a7686004b100d212c44f5ebd1aad4a
--- /dev/null
+++ b/chromecast/graphics/osd_plane_default.cc
@@ -0,0 +1,73 @@
+// 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.
+
+#include "base/memory/scoped_ptr.h"
+#include "chromecast/public/graphics_types.h"
+#include "chromecast/public/osd_plane.h"
+#include "chromecast/public/osd_plane_shlib.h"
+#include "chromecast/public/osd_surface.h"
+
+namespace chromecast {
+namespace {
+
+// Default no-op OsdSurface implementation
+class OsdSurfaceDefault : public OsdSurface {
+ public:
+ OsdSurfaceDefault(const Size& size) : size_(size) {}
+
+ // OsdSurface implementation:
+ void Blit(OsdSurface* src_surface,
+ const Rect& src_rect,
+ const Point& dst_point) override {}
+ void Composite(OsdSurface* src_surface,
+ const Rect& src_rect,
+ const Point& dst_point) override {}
+ void CopyBitmap(char* src_bitmap,
+ const Rect& src_rect,
+ const Rect& damage_rect,
+ const Point& dst_point) override {}
+ void Fill(const Rect& rect, int argb) override {}
+
+ const Size& size() const override { return size_; }
+
+ private:
+ const Size size_;
+
+ DISALLOW_COPY_AND_ASSIGN(OsdSurfaceDefault);
+};
+
+// Default no-op OsdPlane implementation
+class OsdPlaneDefault : public OsdPlane {
+ public:
+ OsdPlaneDefault() : size_(0, 0) {}
+
+ // OsdPlane implementation:
+ OsdSurface* CreateSurface(const Size& size) override {
+ return new OsdSurfaceDefault(size);
+ }
+ void SetClipRectangle(const Rect& rect) override {
+ size_ = Size(rect.width, rect.height);
+ }
+ OsdSurface* GetBackBuffer() override {
+ if (!back_buffer_)
+ back_buffer_.reset(new OsdSurfaceDefault(size_));
+ return back_buffer_.get();
+ }
+
+ void Flip() override {}
+
+ private:
+ scoped_ptr<OsdSurface> back_buffer_;
+ Size size_;
+
+ DISALLOW_COPY_AND_ASSIGN(OsdPlaneDefault);
+};
+
+} // namespace
+
+OsdPlane* OsdPlaneShlib::Create(const std::vector<std::string>& argv) {
+ return new OsdPlaneDefault;
+}
+
+} // namespace chromecast
« no previous file with comments | « chromecast/chromecast.gyp ('k') | chromecast/public/cast_egl_platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698