Rename hittable to hitTestable (flutter/engine#3275)

Apparently hittable is not politically correct.
This commit is contained in:
Adam Barth
2016-11-28 16:09:56 -08:00
committed by GitHub
parent f119bf25db
commit 323a082f5d
5 changed files with 11 additions and 9 deletions

View File

@@ -42,8 +42,10 @@ void ChildSceneLayer::UpdateScene(SceneUpdateContext& context,
resource->get_scene()->scene_token->value = scene_token_;
auto node = mozart::Node::New();
if (!hittable_) {
if (!hit_testable_) {
node->hit_test_behavior = mozart::HitTestBehavior::New();
node->hit_test_behavior->visibility =
mozart::HitTestBehavior::Visibility::INVISIBLE;
node->hit_test_behavior->prune = true;
}
node->op = mozart::NodeOp::New();

View File

@@ -27,7 +27,7 @@ class ChildSceneLayer : public Layer {
void set_scene_token(uint32_t scene_token) { scene_token_ = scene_token; }
void set_hittable(bool hittable) { hittable_ = hittable; }
void set_hit_testable(bool hit_testable) { hit_testable_ = hit_testable; }
void Preroll(PrerollContext* context, const SkMatrix& matrix) override;
void Paint(PaintContext& context) override;
@@ -39,7 +39,7 @@ class ChildSceneLayer : public Layer {
float device_pixel_ratio_ = 1.0;
SkISize physical_size_;
uint32_t scene_token_ = 0;
bool hittable_ = true;
bool hit_testable_ = true;
SkMatrix transform_;
FTL_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer);

View File

@@ -197,7 +197,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
int physicalWidth: 0,
int physicalHeight: 0,
int sceneToken,
bool hittable: true,
bool hitTestable: true,
}) {
_addChildScene(offset.dx,
offset.dy,
@@ -205,7 +205,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
physicalWidth,
physicalHeight,
sceneToken,
hittable);
hitTestable);
}
void _addChildScene(double dx,
double dy,
@@ -213,7 +213,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
int physicalWidth,
int physicalHeight,
int sceneToken,
bool hittable) native "SceneBuilder_addChildScene";
bool hitTestable) native "SceneBuilder_addChildScene";
/// Sets a threshold after which additional debugging information should be recorded.
///

View File

@@ -204,7 +204,7 @@ void SceneBuilder::addChildScene(double dx,
int physicalWidth,
int physicalHeight,
uint32_t sceneToken,
bool hittable) {
bool hitTestable) {
#if defined(OS_FUCHSIA)
if (!m_currentLayer)
return;
@@ -219,7 +219,7 @@ void SceneBuilder::addChildScene(double dx,
layer->set_device_pixel_ratio(devicePixelRatio);
layer->set_physical_size(SkISize::Make(physicalWidth, physicalHeight));
layer->set_scene_token(sceneToken);
layer->set_hittable(hittable);
layer->set_hit_testable(hitTestable);
m_currentLayer->Add(std::move(layer));
#endif
}

View File

@@ -60,7 +60,7 @@ class SceneBuilder : public ftl::RefCountedThreadSafe<SceneBuilder>,
int physicalWidth,
int physicalHeight,
uint32_t sceneToken,
bool hittable);
bool hitTestable);
void setRasterizerTracingThreshold(uint32_t frameInterval);