diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 22:59:37 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 22:59:37 +0000 |
commit | c1bf07dd1da400c45c8b0af7aa3f24dfdbbfc615 (patch) | |
tree | d7df97e6184d7be23e1710be728332f1d0077f68 /o3d/plugin/idl/client.idl | |
parent | 013a4d61cc1d89a24690dfead3e6b22377d5993a (diff) | |
download | chromium_src-c1bf07dd1da400c45c8b0af7aa3f24dfdbbfc615.zip chromium_src-c1bf07dd1da400c45c8b0af7aa3f24dfdbbfc615.tar.gz chromium_src-c1bf07dd1da400c45c8b0af7aa3f24dfdbbfc615.tar.bz2 |
Add ClientInfo
This allows an app to ask a few things from the client.
1) How many objects the client is tracking. This is useful
for a quick way to check that you're freeing resources.
While the developer could use client.objects.length or
client.packs[ii].objects.length that wouldend up creating
hundreds of thousands of NPObjects.
2) Check if the software renderer is being used
3) Check the approximate amount of memory used by textures.
Again, they could compute this with
client.getObjectsByClassName('o3d.Texture') but it seemed
like it might be useful.
I say approximate because I would have to dig down into
the indivdual renderers to get better info since a NPOT
card will use more memory but it didn't seem worth it.
4) check the approximate amount of memory used by hardware
buffers.
Review URL: http://codereview.chromium.org/155276
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin/idl/client.idl')
-rw-r--r-- | o3d/plugin/idl/client.idl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/o3d/plugin/idl/client.idl b/o3d/plugin/idl/client.idl index f30b0e4..fb16e1d 100644 --- a/o3d/plugin/idl/client.idl +++ b/o3d/plugin/idl/client.idl @@ -94,6 +94,33 @@ class Renderer { }; %[ + The ClientInfo is used to get information about the client. +%] +[binding_model=by_value, include="core/cross/client_info.h", nocpp, glue_iface] +class ClientInfo { + %[ + The number of objects the client is currently tracking. + You can use this to check that you are correctly freeing resources. + %] + [getter] int num_objects; + + %[ + The amount of texture memory used. + %] + [getter] int texture_memory_used; + + %[ + The amount of texture memory used. + %] + [getter] int buffer_memory_used; + + %[ + Whether or not O3D is using the software renderer. + %] + [getter] bool software_renderer; +}; + +%[ The Client class is the main point of entry to O3D. It defines methods for creating and deleting packs. Each new object created by the Client is assigned a unique ID. @@ -236,6 +263,12 @@ class Client { [userglue, plugin_data] void CancelFullscreenDisplay(); %[ + Gets info about the client. + %] + [userglue_getter, getter, plugin_data] + ClientInfo client_info; + + %[ Whether content is displayed in full-screen mode or in a plugin window. The default is false [not full-screen]. %] @@ -526,6 +559,14 @@ class Client { o3d::Client* self) { return self->GetByClass<o3d::ObjectBase>(); } + o3d::ClientInfo userglue_getter_client_info( + void *plugin_data, o3d::Client *self) { + glue::_o3d::PluginObject *plugin = + static_cast<glue::_o3d::PluginObject*>(plugin_data); + o3d::ClientInfoManager* client_info_manager = + plugin->service_locator()->GetService<o3d::ClientInfoManager>(); + return client_info_manager->client_info(); + } std::vector<o3d::DisplayMode> userglue_method_GetDisplayModes( void *plugin_data, o3d::Client *self) { std::vector<o3d::DisplayMode> modes; |