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

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

Issue 1195963006: Removing getBackingTextureImage from ImageBufferSurface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix unit test Created 5 years, 6 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 Canvas2DLayerManager::get().layerDidDraw(this); 506 Canvas2DLayerManager::get().layerDidDraw(this);
507 } 507 }
508 508
509 void Canvas2DLayerBridge::finalizeFrame(const FloatRect &dirtyRect) 509 void Canvas2DLayerBridge::finalizeFrame(const FloatRect &dirtyRect)
510 { 510 {
511 ASSERT(!m_destructionInProgress); 511 ASSERT(!m_destructionInProgress);
512 m_layer->layer()->invalidateRect(enclosingIntRect(dirtyRect)); 512 m_layer->layer()->invalidateRect(enclosingIntRect(dirtyRect));
513 m_didRecordDrawCommand = true; 513 m_didRecordDrawCommand = true;
514 } 514 }
515 515
516 PassRefPtr<SkImage> Canvas2DLayerBridge::getBackingTextureImage()
517 {
518 if (!checkSurfaceValid())
519 return nullptr;
520
521 context()->flush();
522
523 return adoptRef(m_canvas->newImageSnapshot());
524 }
525
526 PassRefPtr<SkImage> Canvas2DLayerBridge::newImageSnapshot() 516 PassRefPtr<SkImage> Canvas2DLayerBridge::newImageSnapshot()
527 { 517 {
518 if (!checkSurfaceValid())
519 return nullptr;
528 return adoptRef(m_canvas->newImageSnapshot()); 520 return adoptRef(m_canvas->newImageSnapshot());
529 } 521 }
530 522
531 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { 523 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) {
532 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); 524 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox));
533 m_image = other.m_image; 525 m_image = other.m_image;
534 m_parentLayerBridge = other.m_parentLayerBridge; 526 m_parentLayerBridge = other.m_parentLayerBridge;
535 } 527 }
536 528
537 } // namespace blink 529 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/Canvas2DLayerBridge.h ('k') | Source/platform/graphics/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698