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

Unified Diff: ppapi/proxy/graphics_2d_resource.cc

Issue 252663002: Track plugin input event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add more comments Created 6 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: ppapi/proxy/graphics_2d_resource.cc
diff --git a/ppapi/proxy/graphics_2d_resource.cc b/ppapi/proxy/graphics_2d_resource.cc
index 0cf746570042c15c50c751849e7931bdbe067115..97bc05ab4a220888c20b2da9c95e14ac7789cac0 100644
--- a/ppapi/proxy/graphics_2d_resource.cc
+++ b/ppapi/proxy/graphics_2d_resource.cc
@@ -12,6 +12,7 @@
#include "ppapi/c/ppb_graphics_2d.h"
#include "ppapi/proxy/dispatch_reply_message.h"
#include "ppapi/proxy/plugin_dispatcher.h"
+#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/resource_tracker.h"
@@ -65,6 +66,8 @@ void Graphics2DResource::PaintImageData(PP_Resource image_data,
return;
}
+ PluginGlobals::Get()->OnGraphicsInvalidation(pp_instance());
+
PP_Rect dummy;
memset(&dummy, 0, sizeof(PP_Rect));
Post(RENDERER, PpapiHostMsg_Graphics2D_PaintImageData(
@@ -74,6 +77,7 @@ void Graphics2DResource::PaintImageData(PP_Resource image_data,
void Graphics2DResource::Scroll(const PP_Rect* clip_rect,
const PP_Point* amount) {
+ PluginGlobals::Get()->OnGraphicsInvalidation(pp_instance());
PP_Rect dummy;
memset(&dummy, 0, sizeof(PP_Rect));
Post(RENDERER, PpapiHostMsg_Graphics2D_Scroll(
@@ -94,6 +98,7 @@ void Graphics2DResource::ReplaceContents(PP_Resource image_data) {
"Graphics2DResource.PaintImageData: Bad image resource.");
return;
}
+ PluginGlobals::Get()->OnGraphicsInvalidation(pp_instance());
enter_image.object()->SetIsCandidateForReuse();
Post(RENDERER, PpapiHostMsg_Graphics2D_ReplaceContents(
@@ -122,9 +127,12 @@ int32_t Graphics2DResource::Flush(scoped_refptr<TrackedCallback> callback) {
return PP_ERROR_INPROGRESS; // Can't have >1 flush pending.
current_flush_callback_ = callback;
+ std::vector<ui::LatencyInfo> latency_info;
+ PluginGlobals::Get()->OnGraphicsFlush(&latency_info, pp_instance());
+
Call<PpapiPluginMsg_Graphics2D_FlushAck>(
RENDERER,
- PpapiHostMsg_Graphics2D_Flush(),
+ PpapiHostMsg_Graphics2D_Flush(latency_info),
base::Bind(&Graphics2DResource::OnPluginMsgFlushACK, this));
return PP_OK_COMPLETIONPENDING;
}

Powered by Google App Engine
This is Rietveld 408576698