diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/chromium/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc b/chromium/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc index 3593258deb0..a696431a6d0 100644 --- a/chromium/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc +++ b/chromium/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc @@ -4,13 +4,12 @@ #include "third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.h" +#include "base/metrics/histogram_functions.h" +#include "third_party/blink/renderer/bindings/modules/v8/v8_canvas_context_creation_attributes_module.h" #include "third_party/blink/renderer/core/dom/dom_node_ids.h" -#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h" #include "third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h" #include "third_party/blink/renderer/modules/canvas/htmlcanvas/canvas_context_creation_attributes_helpers.h" -#include "third_party/blink/renderer/modules/canvas/htmlcanvas/canvas_context_creation_attributes_module.h" -#include "third_party/blink/renderer/platform/instrumentation/histogram.h" namespace blink { @@ -18,8 +17,8 @@ void HTMLCanvasElementModule::getContext( HTMLCanvasElement& canvas, const String& type, const CanvasContextCreationAttributesModule* attributes, - ExceptionState& exception_state, - RenderingContext& result) { + RenderingContext& result, + ExceptionState& exception_state) { if (canvas.SurfaceLayerBridge() && !canvas.LowLatencyEnabled()) { // The existence of canvas surfaceLayerBridge indicates that // HTMLCanvasElement.transferControlToOffscreen() has been called. @@ -51,8 +50,8 @@ OffscreenCanvas* HTMLCanvasElementModule::transferControlToOffscreen( execution_context, canvas, exception_state); } - UMA_HISTOGRAM_BOOLEAN("Blink.OffscreenCanvas.TransferControlToOffscreen", - bool(offscreen_canvas)); + base::UmaHistogramBoolean("Blink.OffscreenCanvas.TransferControlToOffscreen", + !!offscreen_canvas); return offscreen_canvas; } @@ -70,12 +69,6 @@ OffscreenCanvas* HTMLCanvasElementModule::TransferControlToOffscreenInternal( execution_context, canvas.width(), canvas.height()); offscreen_canvas->SetFilterQuality(canvas.FilterQuality()); - // If this canvas is cross-origin, then the associated offscreen canvas - // should prefer using the low-power GPU. - LocalFrame* frame = canvas.GetDocument().GetFrame(); - if (!(frame && frame->IsCrossOriginSubframe())) - offscreen_canvas->AllowHighPerformancePowerPreference(); - DOMNodeId canvas_id = DOMNodeIds::IdForNode(&canvas); canvas.RegisterPlaceholderCanvas(static_cast<int>(canvas_id)); offscreen_canvas->SetPlaceholderCanvasId(canvas_id); |