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

Unified Diff: content/renderer/pepper/ppb_graphics_3d_impl.h

Issue 1864723003: Make lost context and error message callbacks on GpuControl go to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: errorcallback: nitmissed Created 4 years, 8 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/pepper/ppb_graphics_3d_impl.h
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.h b/content/renderer/pepper/ppb_graphics_3d_impl.h
index 6dd34624f76fca7309570a1f3d25ab6335fa95c0..57ac15b6d0829bb15c39d5f87b43cef4a0642d9d 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.h
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/shared_memory.h"
#include "base/memory/weak_ptr.h"
+#include "gpu/command_buffer/client/gpu_control_client.h"
#include "gpu/command_buffer/common/command_buffer_id.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/sync_token.h"
@@ -24,7 +25,8 @@ class GpuChannelHost;
namespace content {
-class PPB_Graphics3D_Impl : public ppapi::PPB_Graphics3D_Shared {
+class PPB_Graphics3D_Impl : public ppapi::PPB_Graphics3D_Shared,
+ public gpu::GpuControlClient {
public:
static PP_Resource CreateRaw(PP_Instance instance,
PP_Resource share_context,
@@ -81,10 +83,12 @@ class PPB_Graphics3D_Impl : public ppapi::PPB_Graphics3D_Shared {
base::SharedMemoryHandle* shared_state_handle,
gpu::CommandBufferId* command_buffer_id);
- // Notifications received from the GPU process.
+ // GpuControlClient implementation.
+ void OnGpuControlLostContext() final;
+ void OnGpuControlErrorMessage(const char* msg, int id) final;
+
+ // Other notifications from the GPU process.
void OnSwapBuffers();
- void OnContextLost();
- void OnConsoleMessage(const std::string& msg, int id);
// Notifications sent to plugin.
void SendContextLost();
@@ -93,6 +97,10 @@ class PPB_Graphics3D_Impl : public ppapi::PPB_Graphics3D_Shared {
// True when waiting for compositor to commit our backing texture.
bool commit_pending_;
+#if DCHECK_IS_ON()
+ bool lost_context_ = false;
+#endif
+
gpu::Mailbox mailbox_;
gpu::SyncToken sync_token_;
bool has_alpha_;
« no previous file with comments | « content/renderer/pepper/pepper_video_encoder_host.cc ('k') | content/renderer/pepper/ppb_graphics_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698