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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 2294383002: Make OffscreenCanvas a member of CanvasImageSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 bool CanvasRenderingContext2D::hasImageBuffer() const 577 bool CanvasRenderingContext2D::hasImageBuffer() const
578 { 578 {
579 return canvas()->hasImageBuffer(); 579 return canvas()->hasImageBuffer();
580 } 580 }
581 581
582 ImageBuffer* CanvasRenderingContext2D::imageBuffer() const 582 ImageBuffer* CanvasRenderingContext2D::imageBuffer() const
583 { 583 {
584 return canvas()->buffer(); 584 return canvas()->buffer();
585 } 585 }
586 586
587 PassRefPtr<Image> blink::CanvasRenderingContext2D::getImage(SnapshotReason reaso n) const
588 {
589 if (!hasImageBuffer())
590 return nullptr;
591 return canvas()->buffer()->newImageSnapshot(PreferAcceleration, reason);
592 }
593
587 bool CanvasRenderingContext2D::parseColorOrCurrentColor(Color& color, const Stri ng& colorString) const 594 bool CanvasRenderingContext2D::parseColorOrCurrentColor(Color& color, const Stri ng& colorString) const
588 { 595 {
589 return ::blink::parseColorOrCurrentColor(color, colorString, canvas()); 596 return ::blink::parseColorOrCurrentColor(color, colorString, canvas());
590 } 597 }
591 598
592 HitTestCanvasResult* CanvasRenderingContext2D::getControlAndIdIfHitRegionExists( const LayoutPoint& location) 599 HitTestCanvasResult* CanvasRenderingContext2D::getControlAndIdIfHitRegionExists( const LayoutPoint& location)
593 { 600 {
594 if (hitRegionsCount() <= 0) 601 if (hitRegionsCount() <= 0)
595 return HitTestCanvasResult::create(String(), nullptr); 602 return HitTestCanvasResult::create(String(), nullptr);
596 603
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 return true; 1097 return true;
1091 } 1098 }
1092 1099
1093 void CanvasRenderingContext2D::resetUsageTracking() 1100 void CanvasRenderingContext2D::resetUsageTracking()
1094 { 1101 {
1095 UsageCounters newCounters; 1102 UsageCounters newCounters;
1096 m_usageCounters = newCounters; 1103 m_usageCounters = newCounters;
1097 } 1104 }
1098 1105
1099 } // namespace blink 1106 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698