1. simon_linden
  2. viewer-rabbit

Commits

Richard Nelson  committed 28f52b3

optimizations in button rendering

  • Participants
  • Parent commits 3b704b1
  • Branches default

Comments (0)

Files changed (3)

File indra/llui/llbutton.cpp

View file
  • Ignore whitespace
 	mFlashing( FALSE ),
 	mCurGlowStrength(0.f),
 	mNeedsHighlight(FALSE),
+	mMouseOver(false),
 	mUnselectedLabel(p.label()),
 	mSelectedLabel(p.label_selected()),
 	mGLFont(p.font),
 	LLUICtrl::onMouseEnter(x, y, mask);
 
 	if (isInEnabledChain())
+	{
 		mNeedsHighlight = TRUE;
+	}
+
+	mMouseOver = true;
 }
 
 void LLButton::onMouseLeave(S32 x, S32 y, MASK mask)
 	LLUICtrl::onMouseLeave(x, y, mask);
 
 	mNeedsHighlight = FALSE;
+	mMouseOver = true;
 }
 
 void LLButton::setHighlight(bool b)
 	}
 
 	// Unselected image assignments
-	S32 local_mouse_x;
-	S32 local_mouse_y;
-	LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y);
-
 	bool enabled = isInEnabledChain();
 
 	bool pressed = pressed_by_keyboard 
-					|| (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y))
+					|| (hasMouseCapture() && mMouseOver)
 					|| mForcePressedState;
 	bool selected = getToggleState();
 	

File indra/llui/llbutton.h

View file
  • Ignore whitespace
 	BOOL						mCommitOnReturn;
 	BOOL						mFadeWhenDisabled;
 	bool						mForcePressedState;
+	bool						mMouseOver;
 
 	LLFrameTimer				mFlashingTimer;
 };

File indra/newview/llviewerwindow.cpp

View file
  • Ignore whitespace
 	// only update mouse hover set when UI is visible (since we shouldn't send hover events to invisible UI
 	if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
 	{
-		// include all ancestors of captor_view as automatically having mouse
-		if (captor_view)
-		{
-			LLView* captor_parent_view = captor_view->getParent();
-			while(captor_parent_view)
-			{
-				mouse_hover_set.insert(captor_parent_view->getHandle());
-				captor_parent_view = captor_parent_view->getParent();
-			}
-		}
-
 		// aggregate visible views that contain mouse cursor in display order
 		LLPopupView::popup_list_t popups = mPopupView->getCurrentPopups();