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

Unified Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp

Issue 2851573002: Add trace events corresponding to OffscreenCanvas overhead (Closed)
Patch Set: rebase Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
index 5f641a1a9c7c3aec9d1ab5f5a874d8c8615996db..c94e05c81040f6398d1c29b041800fc63abdf881 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
@@ -19,6 +19,7 @@
#include "platform/graphics/OffscreenCanvasFrameDispatcherImpl.h"
#include "platform/graphics/StaticBitmapImage.h"
#include "platform/image-encoders/ImageEncoderUtils.h"
+#include "platform/instrumentation/tracing/TraceEvent.h"
#include "platform/wtf/MathExtras.h"
#include "public/platform/Platform.h"
#include "third_party/skia/include/core/SkSurface.h"
@@ -240,6 +241,8 @@ ScriptPromise OffscreenCanvas::Commit(RefPtr<StaticBitmapImage> image,
bool is_web_gl_software_rendering,
ScriptState* script_state,
ExceptionState& exception_state) {
+ TRACE_EVENT0("blink", "OffscreenCanvas::Commit");
+
if (!HasPlaceholderCanvas()) {
exception_state.ThrowDOMException(
kInvalidStateError,
@@ -286,12 +289,14 @@ void OffscreenCanvas::FinalizeFrame() {
void OffscreenCanvas::DoCommit(RefPtr<StaticBitmapImage> image,
bool is_web_gl_software_rendering) {
+ TRACE_EVENT0("blink", "OffscreenCanvas::DoCommit");
double commit_start_time = WTF::MonotonicallyIncreasingTime();
GetOrCreateFrameDispatcher()->DispatchFrame(
std::move(image), commit_start_time, is_web_gl_software_rendering);
}
void OffscreenCanvas::BeginFrame() {
+ TRACE_EVENT0("blink", "OffscreenCanvas::BeginFrame");
if (current_frame_) {
// TODO(eseckler): beginFrame() shouldn't be used as confirmation of
// CompositorFrame activation.
@@ -304,6 +309,7 @@ void OffscreenCanvas::BeginFrame() {
} else if (commit_promise_resolver_) {
commit_promise_resolver_->Resolve();
commit_promise_resolver_.Clear();
+
// We need to tell parent frame to stop sending signals on begin frame to
// avoid overhead once we resolve the promise.
GetOrCreateFrameDispatcher()->SetNeedsBeginFrame(false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698