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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 616703003: Should remove |struct HitRegionOptionsInternal|. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 3 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 | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | Source/core/html/canvas/HitRegion.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 5230cf68daf101e33efea90053d80324a24e893a..beebaf198d5f8bfbc11d9077877f0b361b7cb372 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -55,7 +55,6 @@
#include "core/html/canvas/CanvasGradient.h"
#include "core/html/canvas/CanvasPattern.h"
#include "core/html/canvas/CanvasStyle.h"
-#include "core/html/canvas/HitRegionOptions.h"
#include "core/html/canvas/Path2D.h"
#include "core/rendering/RenderImage.h"
#include "core/rendering/RenderLayer.h"
@@ -2390,10 +2389,7 @@ void CanvasRenderingContext2D::drawFocusRing(const Path& path)
void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, ExceptionState& exceptionState)
{
- HitRegionOptionsInternal passOptions;
- passOptions.id = options.id();
- passOptions.control = options.control();
- if (passOptions.id.isEmpty() && !passOptions.control) {
+ if (options.id().isEmpty() && !options.control()) {
exceptionState.throwDOMException(NotSupportedError, "Both id and control are null.");
return;
}
@@ -2419,26 +2415,14 @@ void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc
return;
}
- passOptions.path = hitRegionPath;
-
- if (options.fillRule() != "evenodd")
- passOptions.fillRule = RULE_NONZERO;
- else
- passOptions.fillRule = RULE_EVENODD;
-
- addHitRegionInternal(passOptions, exceptionState);
-}
-
-void CanvasRenderingContext2D::addHitRegionInternal(const HitRegionOptionsInternal& options, ExceptionState& exceptionState)
-{
if (!m_hitRegionManager)
m_hitRegionManager = HitRegionManager::create();
// Remove previous region (with id or control)
- m_hitRegionManager->removeHitRegionById(options.id);
- m_hitRegionManager->removeHitRegionByControl(options.control.get());
+ m_hitRegionManager->removeHitRegionById(options.id());
+ m_hitRegionManager->removeHitRegionByControl(options.control().get());
- RefPtrWillBeRawPtr<HitRegion> hitRegion = HitRegion::create(options);
+ RefPtrWillBeRawPtr<HitRegion> hitRegion = HitRegion::create(hitRegionPath, options);
hitRegion->updateAccessibility(canvas());
m_hitRegionManager->addHitRegion(hitRegion.release());
}
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | Source/core/html/canvas/HitRegion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698