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

Side by Side Diff: third_party/WebKit/Source/core/frame/ImageBitmap.cpp

Issue 2362363002: Cancel GPU acceleration for 2D canvas when drawing very large images (Closed)
Patch Set: fix sqrt Created 4 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "core/frame/ImageBitmap.h" 5 #include "core/frame/ImageBitmap.h"
6 6
7 #include "core/html/HTMLCanvasElement.h" 7 #include "core/html/HTMLCanvasElement.h"
8 #include "core/html/HTMLVideoElement.h" 8 #include "core/html/HTMLVideoElement.h"
9 #include "core/html/ImageData.h" 9 #include "core/html/ImageData.h"
10 #include "platform/graphics/skia/SkiaUtils.h" 10 #include "platform/graphics/skia/SkiaUtils.h"
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 } 666 }
667 667
668 unsigned long ImageBitmap::height() const 668 unsigned long ImageBitmap::height() const
669 { 669 {
670 if (!m_image) 670 if (!m_image)
671 return 0; 671 return 0;
672 ASSERT(m_image->height() > 0); 672 ASSERT(m_image->height() > 0);
673 return m_image->height(); 673 return m_image->height();
674 } 674 }
675 675
676 bool ImageBitmap::isTextureBacked() const 676 bool ImageBitmap::isAccelerated() const
677 { 677 {
678 return m_image && (m_image->isTextureBacked() || m_image->hasMailbox()); 678 return m_image && (m_image->isTextureBacked() || m_image->hasMailbox());
679 } 679 }
680 680
681 IntSize ImageBitmap::size() const 681 IntSize ImageBitmap::size() const
682 { 682 {
683 if (!m_image) 683 if (!m_image)
684 return IntSize(); 684 return IntSize();
685 ASSERT(m_image->width() > 0 && m_image->height() > 0); 685 ASSERT(m_image->width() > 0 && m_image->height() > 0);
686 return IntSize(m_image->width(), m_image->height()); 686 return IntSize(m_image->width(), m_image->height());
(...skipping 22 matching lines...) Expand all
709 FloatSize ImageBitmap::elementSize(const FloatSize&) const 709 FloatSize ImageBitmap::elementSize(const FloatSize&) const
710 { 710 {
711 return FloatSize(width(), height()); 711 return FloatSize(width(), height());
712 } 712 }
713 713
714 DEFINE_TRACE(ImageBitmap) 714 DEFINE_TRACE(ImageBitmap)
715 { 715 {
716 } 716 }
717 717
718 } // namespace blink 718 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/ImageBitmap.h ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698