~zeitgeist/plank/zeitgeist

« back to all changes in this revision

Viewing changes to lib/Drawing/DockSurface.vala

  • Committer: Rico Tzschichholz
  • Date: 2015-04-28 11:15:06 UTC
  • Revision ID: ricotz@ubuntu.com-20150428111506-463jt1z8sa5vs420
docksurface: Cache "Context" property

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
                 */
101
101
                public void clear ()
102
102
                {
103
 
                        Context.save ();
104
 
                        Context.set_operator (Cairo.Operator.CLEAR);
105
 
                        Context.paint ();
106
 
                        Context.restore ();
 
103
                        unowned Cairo.Context cr = Context;
 
104
                        
 
105
                        cr.save ();
 
106
                        cr.set_operator (Cairo.Operator.CLEAR);
 
107
                        cr.paint ();
 
108
                        cr.restore ();
107
109
                }
108
110
                
109
111
                /**
329
331
                        
330
332
                        original.mark_dirty ();
331
333
                        
332
 
                        Context.save ();
333
 
                        Context.set_operator (Cairo.Operator.SOURCE);
334
 
                        Context.set_source_surface (original, 0, 0);
335
 
                        Context.paint ();
336
 
                        Context.restore ();
 
334
                        unowned Cairo.Context target_cr = Context;
 
335
                        target_cr.save ();
 
336
                        target_cr.set_operator (Cairo.Operator.SOURCE);
 
337
                        target_cr.set_source_surface (original, 0, 0);
 
338
                        target_cr.paint ();
 
339
                        target_cr.restore ();
337
340
                }
338
341
                
339
342
                const int AlphaPrecision = 16;
381
384
                        
382
385
                        original.mark_dirty ();
383
386
                        
384
 
                        Context.save ();
385
 
                        Context.set_operator (Cairo.Operator.SOURCE);
386
 
                        Context.set_source_surface (original, 0, 0);
387
 
                        Context.paint ();
388
 
                        Context.restore ();
 
387
                        unowned Cairo.Context target_cr = Context;
 
388
                        target_cr.save ();
 
389
                        target_cr.set_operator (Cairo.Operator.SOURCE);
 
390
                        target_cr.set_source_surface (original, 0, 0);
 
391
                        target_cr.paint ();
 
392
                        target_cr.restore ();
389
393
                }
390
394
                
391
395
                void exponential_blur_columns (uint8* pixels, int width, int height, int startCol, int endCol, int startY, int endY, int alpha)
526
530
                        
527
531
                        original.mark_dirty ();
528
532
                        
529
 
                        Context.save ();
530
 
                        Context.set_operator (Cairo.Operator.SOURCE);
531
 
                        Context.set_source_surface (original, 0, 0);
532
 
                        Context.paint ();
533
 
                        Context.restore ();
 
533
                        unowned Cairo.Context target_cr = Context;
 
534
                        target_cr.save ();
 
535
                        target_cr.set_operator (Cairo.Operator.SOURCE);
 
536
                        target_cr.set_source_surface (original, 0, 0);
 
537
                        target_cr.paint ();
 
538
                        target_cr.restore ();
534
539
                }
535
540
 
536
541
                void gaussian_blur_horizontal (double* src, double* dest, double* kernel, int gaussWidth, int width, int height, int startRow, int endRow, int[,] shift)