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

Side by Side Diff: sky/sdk/lib/rendering/object.dart

Issue 1237623004: Remove onFrame callback (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 import 'dart:sky' show Point, Offset, Size, Rect, Color, Paint, Path; 7 import 'dart:sky' show Point, Offset, Size, Rect, Color, Paint, Path;
8 8
9 import 'package:sky/base/debug.dart'; 9 import 'package:sky/base/debug.dart';
10 import 'package:sky/base/hit_test.dart'; 10 import 'package:sky/base/hit_test.dart';
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 scheduler.ensureVisualUpdate(); 330 scheduler.ensureVisualUpdate();
331 } else { 331 } else {
332 assert(parent != null); // parent always exists on this path because the r oot node is a RenderView, which sets createNewDisplayList. 332 assert(parent != null); // parent always exists on this path because the r oot node is a RenderView, which sets createNewDisplayList.
333 if (parent is RenderObject) { 333 if (parent is RenderObject) {
334 (parent as RenderObject).markNeedsPaint(); // TODO(ianh): remove the cas t once the analyzer is cleverer 334 (parent as RenderObject).markNeedsPaint(); // TODO(ianh): remove the cas t once the analyzer is cleverer
335 } 335 }
336 } 336 }
337 } 337 }
338 338
339 static void flushPaint() { 339 static void flushPaint() {
340 sky.tracing.begin('RenderObject.flushPaint');
341 _debugDoingPaint = true;
340 try { 342 try {
341 _debugDoingPaint = true;
342 List<RenderObject> dirtyNodes = _nodesNeedingPaint; 343 List<RenderObject> dirtyNodes = _nodesNeedingPaint;
343 _nodesNeedingPaint = new List<RenderObject>(); 344 _nodesNeedingPaint = new List<RenderObject>();
344 for (RenderObject node in dirtyNodes..sort((a, b) => a.depth - b.depth)) { 345 for (RenderObject node in dirtyNodes..sort((a, b) => a.depth - b.depth)) {
345 if (node._needsPaint && node.attached) 346 if (node._needsPaint && node.attached)
346 node._updatePaintingCanvas(); 347 node._updatePaintingCanvas();
347 }; 348 };
348 assert(_nodesNeedingPaint.length == 0); 349 assert(_nodesNeedingPaint.length == 0);
349 } finally { 350 } finally {
350 _debugDoingPaint = false; 351 _debugDoingPaint = false;
352 sky.tracing.end('RenderObject.flushPaint');
351 } 353 }
352 } 354 }
353 355
354 void _updatePaintingCanvas() { 356 void _updatePaintingCanvas() {
355 assert(!_needsLayout); 357 assert(!_needsLayout);
356 assert(createNewDisplayList); 358 assert(createNewDisplayList);
357 sky.PictureRecorder recorder = new sky.PictureRecorder(); 359 sky.PictureRecorder recorder = new sky.PictureRecorder();
358 PaintingCanvas canvas = new PaintingCanvas(recorder, paintBounds); 360 PaintingCanvas canvas = new PaintingCanvas(recorder, paintBounds);
359 _needsPaint = false; 361 _needsPaint = false;
360 try { 362 try {
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 int count = 1; 701 int count = 1;
700 ChildType child = _firstChild; 702 ChildType child = _firstChild;
701 while (child != null) { 703 while (child != null) {
702 result += '${prefix}child ${count}: ${child.toString(prefix)}'; 704 result += '${prefix}child ${count}: ${child.toString(prefix)}';
703 count += 1; 705 count += 1;
704 child = child.parentData.nextSibling; 706 child = child.parentData.nextSibling;
705 } 707 }
706 return result; 708 return result;
707 } 709 }
708 } 710 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698