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

Unified Diff: core/cross/gl/renderer_gl.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/gl/renderer_gl.h ('k') | core/cross/image_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/cross/gl/renderer_gl.cc
===================================================================
--- core/cross/gl/renderer_gl.cc (revision 22687)
+++ core/cross/gl/renderer_gl.cc (working copy)
@@ -1560,10 +1560,7 @@
height));
}
-// Saves a png screenshot 'file_name.png'.
-// Returns true on success and false on failure.
-bool RendererGL::SaveScreen(const String& file_name) {
-#ifdef TESTING
+Bitmap::Ref RendererGL::TakeScreenshot() {;
MakeCurrentLazy();
Bitmap::Ref bitmap = Bitmap::Ref(new Bitmap(service_locator()));
bitmap->Allocate(Texture::ARGB8, width(), height(), 1, false);
@@ -1574,16 +1571,7 @@
// might exhibit suprise translucency.
::glReadPixels(0, 0, width(), height(), GL_BGRA, GL_UNSIGNED_BYTE,
bitmap->image_data());
- bool result = bitmap->SaveToPNGFile((file_name + ".png").c_str());
- if (!result) {
- O3D_ERROR(service_locator())
- << "Failed to save screen into " << file_name;
- }
- return result;
-#else
- // Not a test build, always return false.
- return false;
-#endif
+ return bitmap;
}
const int* RendererGL::GetRGBAUByteNSwizzleTable() {
« no previous file with comments | « core/cross/gl/renderer_gl.h ('k') | core/cross/image_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698