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

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

Issue 2300633004: Allow canvases to be GPU-accelerated in Workers (Closed)
Patch Set: test expectation 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 // 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 583
584 ImageBitmap::ImageBitmap(PassRefPtr<StaticBitmapImage> image) 584 ImageBitmap::ImageBitmap(PassRefPtr<StaticBitmapImage> image)
585 { 585 {
586 m_image = image; 586 m_image = image;
587 } 587 }
588 588
589 PassRefPtr<StaticBitmapImage> ImageBitmap::transfer() 589 PassRefPtr<StaticBitmapImage> ImageBitmap::transfer()
590 { 590 {
591 ASSERT(!isNeutered()); 591 ASSERT(!isNeutered());
592 m_isNeutered = true; 592 m_isNeutered = true;
593 m_image->transfer();
593 return m_image.release(); 594 return m_image.release();
594 } 595 }
595 596
596 ImageBitmap::~ImageBitmap() 597 ImageBitmap::~ImageBitmap()
597 { 598 {
598 } 599 }
599 600
600 ImageBitmap* ImageBitmap::create(HTMLImageElement* image, Optional<IntRect> crop Rect, Document* document, const ImageBitmapOptions& options) 601 ImageBitmap* ImageBitmap::create(HTMLImageElement* image, Optional<IntRect> crop Rect, Document* document, const ImageBitmapOptions& options)
601 { 602 {
602 return new ImageBitmap(image, cropRect, document, options); 603 return new ImageBitmap(image, cropRect, document, options);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 FloatSize ImageBitmap::elementSize(const FloatSize&) const 711 FloatSize ImageBitmap::elementSize(const FloatSize&) const
711 { 712 {
712 return FloatSize(width(), height()); 713 return FloatSize(width(), height());
713 } 714 }
714 715
715 DEFINE_TRACE(ImageBitmap) 716 DEFINE_TRACE(ImageBitmap)
716 { 717 {
717 } 718 }
718 719
719 } // namespace blink 720 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698