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

Side by Side Diff: Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 429643002: Add non-blocking frame rate limiting logic to display list 2D canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: applied corrections Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 } 539 }
540 } 540 }
541 541
542 blink::WebLayer* Canvas2DLayerBridge::layer() const 542 blink::WebLayer* Canvas2DLayerBridge::layer() const
543 { 543 {
544 ASSERT(!m_destructionInProgress); 544 ASSERT(!m_destructionInProgress);
545 ASSERT(m_layer); 545 ASSERT(m_layer);
546 return m_layer->layer(); 546 return m_layer->layer();
547 } 547 }
548 548
549 void Canvas2DLayerBridge::willUse() 549 void Canvas2DLayerBridge::didDraw()
550 { 550 {
551 ASSERT(!m_destructionInProgress); 551 ASSERT(!m_destructionInProgress);
552 Canvas2DLayerManager::get().layerDidDraw(this); 552 Canvas2DLayerManager::get().layerDidDraw(this);
553 m_didRecordDrawCommand = true; 553 m_didRecordDrawCommand = true;
554 } 554 }
555 555
556 Platform3DObject Canvas2DLayerBridge::getBackingTexture() 556 Platform3DObject Canvas2DLayerBridge::getBackingTexture()
557 { 557 {
558 ASSERT(!m_destructionInProgress); 558 ASSERT(!m_destructionInProgress);
559 if (!checkSurfaceValid()) 559 if (!checkSurfaceValid())
560 return 0; 560 return 0;
561 willUse();
562 m_canvas->flush(); 561 m_canvas->flush();
563 context()->flush(); 562 context()->flush();
564 GrRenderTarget* renderTarget = m_canvas->getTopDevice()->accessRenderTarget( ); 563 GrRenderTarget* renderTarget = m_canvas->getTopDevice()->accessRenderTarget( );
565 if (renderTarget) { 564 if (renderTarget) {
566 return renderTarget->asTexture()->getTextureHandle(); 565 return renderTarget->asTexture()->getTextureHandle();
567 } 566 }
568 return 0; 567 return 0;
569 } 568 }
570 569
571 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { 570 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) {
572 // This copy constructor should only be used for Vector reallocation 571 // This copy constructor should only be used for Vector reallocation
573 // Assuming 'other' is to be destroyed, we transfer m_image ownership 572 // Assuming 'other' is to be destroyed, we transfer m_image ownership
574 // rather than do a refcount dance. 573 // rather than do a refcount dance.
575 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); 574 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox));
576 m_image = const_cast<MailboxInfo*>(&other)->m_image.release(); 575 m_image = const_cast<MailboxInfo*>(&other)->m_image.release();
577 m_status = other.m_status; 576 m_status = other.m_status;
578 } 577 }
579 578
580 } 579 }
OLDNEW
« no previous file with comments | « Source/platform/graphics/Canvas2DLayerBridge.h ('k') | Source/platform/graphics/Canvas2DLayerManagerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698