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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 9655017: Implement WebKitPlatformSupport::canAccelerate2dCanvas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move canAccelerate.. call next to createOffscreenGraphicsContext3D call Created 8 years, 9 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: content/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index b8df27a25d13bbf46e32ebf9f09415bbef8e40ef..3c674fdb8e14b5c5b556af596631dac3409a0cda 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -20,6 +20,7 @@
#include "content/common/view_messages.h"
#include "content/common/webmessageportchannel_impl.h"
#include "content/public/common/content_switches.h"
+#include "content/public/common/gpu_info.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/gamepad_shared_memory_reader.h"
#include "content/renderer/media/audio_device.h"
@@ -585,6 +586,20 @@ RendererWebKitPlatformSupportImpl::sharedWorkerRepository() {
}
}
+bool RendererWebKitPlatformSupportImpl::canAccelerate2dCanvas() {
+ RenderThreadImpl* thread = RenderThreadImpl::current();
+ GpuChannelHost* host = thread->EstablishGpuChannelSync(
+ content::CAUSE_FOR_GPU_LAUNCH_CANVAS_2D);
+ if (!host)
+ return false;
+
+ const content::GPUInfo& gpu_info = host->gpu_info();
+ if (gpu_info.can_lose_context || gpu_info.software_rendering)
+ return false;
+
+ return true;
+}
+
double RendererWebKitPlatformSupportImpl::audioHardwareSampleRate() {
return audio_hardware::GetOutputSampleRate();
}
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | webkit/support/test_webkit_platform_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698