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

Unified Diff: third_party/libva/test/android_winsys.cpp

Issue 10375035: Add libva to chromium third_party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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: third_party/libva/test/android_winsys.cpp
diff --git a/third_party/libva/test/android_winsys.cpp b/third_party/libva/test/android_winsys.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ba75bdf2163748adb9a13eedcf886d8a938e6f54
--- /dev/null
+++ b/third_party/libva/test/android_winsys.cpp
@@ -0,0 +1,41 @@
+#include <ui/DisplayInfo.h>
+
+namespace android {
+ class Test {
+ public:
+ static const sp<ISurface>& getISurface(const sp<Surface>& s) {
+ return s->getISurface();
+ }
+ };
+};
+
+#define min(a,b) (a<b?a:b)
+#define SURFACE_CREATE(client,surface_ctrl,android_surface, android_isurface, x, y, win_width, win_height) \
+do { \
+ client = new SurfaceComposerClient(); \
+ android::DisplayInfo info; \
+ int w, h; \
+ \
+ client->getDisplayInfo(android::DisplayID(0), &info); \
+ /*w = min(win_width, info.w);*/ \
+ /*h = min(win_height, info.h);*/ \
+ w = win_width, h = win_height; \
+ \
+ surface_ctrl = client->createSurface(getpid(), 0, w, h, PIXEL_FORMAT_RGB_565, ISurfaceComposer::ePushBuffers); \
+ android_surface = surface_ctrl->getSurface(); \
+ android_isurface = Test::getISurface(android_surface); \
+ \
+ client->openTransaction(); \
+ surface_ctrl->setPosition(x, y); \
+ client->closeTransaction(); \
+ \
+ client->openTransaction(); \
+ surface_ctrl->setSize(w, h); \
+ client->closeTransaction(); \
+ \
+ client->openTransaction(); \
+ surface_ctrl->setLayer(0x100000); \
+ client->closeTransaction(); \
+} while (0)
+
+

Powered by Google App Engine
This is Rietveld 408576698