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

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

Issue 2196963002: Add a new class AcceleratedStaticBitmap : StaticBitmapImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + minor clean up Created 4 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
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/AcceleratedStaticBitmapImage.h"
10 #include "platform/graphics/skia/SkiaUtils.h" 11 #include "platform/graphics/skia/SkiaUtils.h"
11 #include "platform/image-decoders/ImageDecoder.h" 12 #include "platform/image-decoders/ImageDecoder.h"
12 #include "third_party/skia/include/core/SkCanvas.h" 13 #include "third_party/skia/include/core/SkCanvas.h"
13 #include "third_party/skia/include/core/SkSurface.h" 14 #include "third_party/skia/include/core/SkSurface.h"
14 #include "wtf/PtrUtil.h" 15 #include "wtf/PtrUtil.h"
15 #include "wtf/RefPtr.h" 16 #include "wtf/RefPtr.h"
16 #include <memory> 17 #include <memory>
17 18
18 namespace blink { 19 namespace blink {
19 20
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 m_image->setPremultiplied(parsedOptions.premultiplyAlpha); 510 m_image->setPremultiplied(parsedOptions.premultiplyAlpha);
510 } 511 }
511 512
512 ImageBitmap::ImageBitmap(PassRefPtr<StaticBitmapImage> image) 513 ImageBitmap::ImageBitmap(PassRefPtr<StaticBitmapImage> image)
513 { 514 {
514 m_image = image; 515 m_image = image;
515 } 516 }
516 517
517 ImageBitmap::ImageBitmap(WebExternalTextureMailbox& mailbox) 518 ImageBitmap::ImageBitmap(WebExternalTextureMailbox& mailbox)
518 { 519 {
519 m_image = StaticBitmapImage::create(mailbox); 520 m_image = AcceleratedStaticBitmapImage::create(mailbox);
520 } 521 }
521 522
522 PassRefPtr<StaticBitmapImage> ImageBitmap::transfer() 523 PassRefPtr<StaticBitmapImage> ImageBitmap::transfer()
523 { 524 {
524 ASSERT(!isNeutered()); 525 ASSERT(!isNeutered());
525 m_isNeutered = true; 526 m_isNeutered = true;
526 return m_image.release(); 527 return m_image.release();
527 } 528 }
528 529
529 ImageBitmap::~ImageBitmap() 530 ImageBitmap::~ImageBitmap()
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 FloatSize ImageBitmap::elementSize(const FloatSize&) const 649 FloatSize ImageBitmap::elementSize(const FloatSize&) const
649 { 650 {
650 return FloatSize(width(), height()); 651 return FloatSize(width(), height());
651 } 652 }
652 653
653 DEFINE_TRACE(ImageBitmap) 654 DEFINE_TRACE(ImageBitmap)
654 { 655 {
655 } 656 }
656 657
657 } // namespace blink 658 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698