NS_IMETHODIMP nsDrawingSurfacePh :: Select( void ) { PhGC_t *gc = PgGetGC(); PhDrawContext_t *dc = PhDCGetCurrent();  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select this=<%p> CurrentGC=<%p> mIsOffscreen=<%d> CurrentDC=<%p> mDrawContext=<%p>\n", this, gc, mIsOffscreen, dc, mDrawContext));  if (mDrawContext != dc) { PhDrawContext_t *old_dc;  old_dc = PhDCSetCurrent(mDrawContext); if (old_dc == NULL) { NS_ASSERTION(old_dc, "nsDrawingSurfacePh::Select new DC can not be made active"); abort(); }  gc = PgGetGC(); dc = PhDCGetCurrent();  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select after set DrawContext CurrentGC=<%p> CurrentDC=<%p>\n", gc, dc)); } else { PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select mDrawContext== CurrentDC\n")); }   gc = PgGetGC(); PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select mGC=<%p> mMC=<%p> gc=<%p>\n", mGC, mMC, gc));  if (gc != mGC) { PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select Setting GC to mGC=<%p>\n", mGC)); PgSetGC(mGC); }  #ifdef DEBUG PhRect_t  *rect; int       rect_count; gc = PgGetGC(); PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select   GC Information: rid=<%d> target_rid=<%d>\n", gc->rid, gc->target_rid)); PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t n_clip_rects=<%d> max_clip_rects=<%d>\n", gc->n_clip_rects,gc->max_clip_rects)); rect_count=gc->n_clip_rects; rect = gc->clip_rects; while(rect_count--) { PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t\t %d (%d,%d) to (%d,%d)\n", rect_count, rect->ul.x, rect->ul.y, rect->lr.x, rect->lr.y)); rect++; }  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t n__user_clip_rects=<%d> max_user_clip_rects=<%d>\n", gc->n_user_clip_rects,gc->max_user_clip_rects)); rect_count=gc->n_user_clip_rects; rect = gc->user_clip_rects; while(rect_count--) { PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t\t %d (%d,%d) to (%d,%d)\n", rect_count, rect->ul.x, rect->ul.y, rect->lr.x, rect->lr.y)); rect++; }  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t aux_clip_valid=<%d>\n", gc->aux_clip_valid)); #endif  return NS_OK; }
inline PhDrawContext_t* Select( ) { PhDCSetCurrent( mDrawContext ); PgSetGCCx( mDrawContext, mGC ); return mDrawContext; }
NS_IMETHODIMP nsDrawingSurfacePh :: Select( void ){  PhGC_t *gc = PgGetGC();  PhDrawContext_t *dc = PhDCGetCurrent();    PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select this=<%p> CurrentGC=<%p> mIsOffscreen=<%d> CurrentDC=<%p> mDrawContext=<%p>\n", this, gc, mIsOffscreen, dc, mDrawContext));  if (mDrawContext != dc)  {    PhDrawContext_t *old_dc;	/* Reset the Draw Context */    old_dc = PhDCSetCurrent(mDrawContext);    if (old_dc == NULL)	{	  NS_ASSERTION(old_dc, "nsDrawingSurfacePh::Select new DC can not be made active");	  abort();		}    gc = PgGetGC();    dc = PhDCGetCurrent();      PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select after set DrawContext CurrentGC=<%p> CurrentDC=<%p>\n", gc, dc));  }  else  {    PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select mDrawContext== CurrentDC\n"));  }    gc = PgGetGC();  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select mGC=<%p> mMC=<%p> gc=<%p>\n", mGC, mMC, gc));    if (gc != mGC)  {    PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select Setting GC to mGC=<%p>\n", mGC));    PgSetGC(mGC);    }#ifdef DEBUG  PhRect_t  *rect;  int       rect_count;  gc = PgGetGC();  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsDrawingSurfacePh::Select   GC Information: rid=<%d> target_rid=<%d>\n", gc->rid, gc->target_rid));  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t n_clip_rects=<%d> max_clip_rects=<%d>\n", gc->n_clip_rects,gc->max_clip_rects));  rect_count=gc->n_clip_rects;  rect = gc->clip_rects;  while(rect_count--)  {    PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t\t %d (%d,%d) to (%d,%d)\n", rect_count, rect->ul.x, rect->ul.y, rect->lr.x, rect->lr.y));    rect++;  }    PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t n__user_clip_rects=<%d> max_user_clip_rects=<%d>\n", gc->n_user_clip_rects,gc->max_user_clip_rects));  rect_count=gc->n_user_clip_rects;  rect = gc->user_clip_rects;  while(rect_count--)  {    PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t\t %d (%d,%d) to (%d,%d)\n", rect_count, rect->ul.x, rect->ul.y, rect->lr.x, rect->lr.y));    rect++;  }  PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("\t aux_clip_valid=<%d>\n", gc->aux_clip_valid));#endif  return NS_OK;}