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

Unified Diff: core/cross/client.cc

Issue 164130: This CL adds client.toDataURL which gets the contents... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 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 | « core/cross/client.h ('k') | core/cross/command_buffer/renderer_cb.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/cross/client.cc
===================================================================
--- core/cross/client.cc (revision 22687)
+++ core/cross/client.cc (working copy)
@@ -55,6 +55,7 @@
#include "core/cross/profiler.h"
#include "utils/cross/string_writer.h"
#include "utils/cross/json_writer.h"
+#include "utils/cross/dataurl.h"
#ifdef OS_WIN
#include "core/cross/core_metrics.h"
@@ -401,12 +402,17 @@
evaluation_counter_->InvalidateAllParameters();
}
-bool Client::SaveScreen(const String& file_name) {
+String Client::ToDataURL() {
if (!renderer_.IsAvailable()) {
O3D_ERROR(service_locator_) << "No Render Device Available";
- return false;
+ return dataurl::kEmptyDataURL;
} else {
- return renderer_->SaveScreen(file_name);
+ Bitmap::Ref bitmap(renderer_->TakeScreenshot());
+ if (bitmap.IsNull()) {
+ return dataurl::kEmptyDataURL;
+ } else {
+ return bitmap->ToDataURL();
+ }
}
}
« no previous file with comments | « core/cross/client.h ('k') | core/cross/command_buffer/renderer_cb.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698