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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2808493002: [blink] Request compositing update when canvas hibernates/wakes up. (Closed)
Patch Set: trigger compositing update from Canvas2DLayerBridge instead Created 3 years, 8 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 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // content did not change because it layer was destroyed. 352 // content did not change because it layer was destroyed.
353 DidDraw(); 353 DidDraw();
354 } 354 }
355 355
356 void HTMLCanvasElement::RestoreCanvasMatrixClipStack( 356 void HTMLCanvasElement::RestoreCanvasMatrixClipStack(
357 PaintCanvas* canvas) const { 357 PaintCanvas* canvas) const {
358 if (context_) 358 if (context_)
359 context_->RestoreCanvasMatrixClipStack(canvas); 359 context_->RestoreCanvasMatrixClipStack(canvas);
360 } 360 }
361 361
362 void HTMLCanvasElement::SetNeedsCompositingUpdate() {
363 Element::SetNeedsCompositingUpdate();
364 }
365
362 void HTMLCanvasElement::DoDeferredPaintInvalidation() { 366 void HTMLCanvasElement::DoDeferredPaintInvalidation() {
363 DCHECK(!dirty_rect_.IsEmpty()); 367 DCHECK(!dirty_rect_.IsEmpty());
364 if (context_->Is2d()) { 368 if (context_->Is2d()) {
365 FloatRect src_rect(0, 0, size().Width(), size().Height()); 369 FloatRect src_rect(0, 0, size().Width(), size().Height());
366 dirty_rect_.Intersect(src_rect); 370 dirty_rect_.Intersect(src_rect);
367 LayoutBox* lb = GetLayoutBox(); 371 LayoutBox* lb = GetLayoutBox();
368 FloatRect invalidation_rect; 372 FloatRect invalidation_rect;
369 if (lb) { 373 if (lb) {
370 FloatRect mapped_dirty_rect = 374 FloatRect mapped_dirty_rect =
371 MapRect(dirty_rect_, src_rect, FloatRect(lb->ContentBoxRect())); 375 MapRect(dirty_rect_, src_rect, FloatRect(lb->ContentBoxRect()));
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 // Creates a placeholder layer first before Surface is created. 1480 // Creates a placeholder layer first before Surface is created.
1477 surface_layer_bridge_->CreateSolidColorLayer(); 1481 surface_layer_bridge_->CreateSolidColorLayer();
1478 } 1482 }
1479 } 1483 }
1480 1484
1481 void HTMLCanvasElement::OnWebLayerReplaced() { 1485 void HTMLCanvasElement::OnWebLayerReplaced() {
1482 SetNeedsCompositingUpdate(); 1486 SetNeedsCompositingUpdate();
1483 } 1487 }
1484 1488
1485 } // namespace blink 1489 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698