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

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

Issue 2026803002: Avoid GPU readback in tex(Sub)Image2D(ImageBitmap) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address kbr@'s comments Created 4 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
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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 } 461 }
462 462
463 unsigned long ImageBitmap::height() const 463 unsigned long ImageBitmap::height() const
464 { 464 {
465 if (!m_image) 465 if (!m_image)
466 return 0; 466 return 0;
467 ASSERT(m_image->height() > 0); 467 ASSERT(m_image->height() > 0);
468 return m_image->height(); 468 return m_image->height();
469 } 469 }
470 470
471 bool ImageBitmap::isTextureBacked() const
472 {
473 return m_image && (m_image->isTextureBacked() || m_image->hasMailbox());
474 }
475
471 IntSize ImageBitmap::size() const 476 IntSize ImageBitmap::size() const
472 { 477 {
473 if (!m_image) 478 if (!m_image)
474 return IntSize(); 479 return IntSize();
475 ASSERT(m_image->width() > 0 && m_image->height() > 0); 480 ASSERT(m_image->width() > 0 && m_image->height() > 0);
476 return IntSize(m_image->width(), m_image->height()); 481 return IntSize(m_image->width(), m_image->height());
477 } 482 }
478 483
479 ScriptPromise ImageBitmap::createImageBitmap(ScriptState* scriptState, EventTarg et& eventTarget, int sx, int sy, int sw, int sh, const ImageBitmapOptions& optio ns, ExceptionState& exceptionState) 484 ScriptPromise ImageBitmap::createImageBitmap(ScriptState* scriptState, EventTarg et& eventTarget, int sx, int sy, int sw, int sh, const ImageBitmapOptions& optio ns, ExceptionState& exceptionState)
480 { 485 {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 FloatSize ImageBitmap::elementSize(const FloatSize&) const 519 FloatSize ImageBitmap::elementSize(const FloatSize&) const
515 { 520 {
516 return FloatSize(width(), height()); 521 return FloatSize(width(), height());
517 } 522 }
518 523
519 DEFINE_TRACE(ImageBitmap) 524 DEFINE_TRACE(ImageBitmap)
520 { 525 {
521 } 526 }
522 527
523 } // namespace blink 528 } // 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