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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp

Issue 1532473002: Add a origin clean flag in ImageBitmap class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: StaticBitmapImage now has a second parameter for origin clean flag Created 4 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "platform/graphics/StaticBitmapImage.h" 5 #include "platform/graphics/StaticBitmapImage.h"
6 6
7 #include "platform/graphics/GraphicsContext.h" 7 #include "platform/graphics/GraphicsContext.h"
8 #include "platform/graphics/ImageObserver.h" 8 #include "platform/graphics/ImageObserver.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "third_party/skia/include/core/SkImage.h" 10 #include "third_party/skia/include/core/SkImage.h"
11 #include "third_party/skia/include/core/SkPaint.h" 11 #include "third_party/skia/include/core/SkPaint.h"
12 #include "third_party/skia/include/core/SkShader.h" 12 #include "third_party/skia/include/core/SkShader.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 PassRefPtr<StaticBitmapImage> StaticBitmapImage::create(PassRefPtr<SkImage> imag e) 16 PassRefPtr<StaticBitmapImage> StaticBitmapImage::create(PassRefPtr<SkImage> imag e, bool hasSingleSecurityOrigin)
17 { 17 {
18 if (!image) 18 if (!image)
19 return nullptr; 19 return nullptr;
20 return adoptRef(new StaticBitmapImage(image)); 20 return adoptRef(new StaticBitmapImage(image, hasSingleSecurityOrigin));
21 } 21 }
22 22
23 StaticBitmapImage::StaticBitmapImage(PassRefPtr<SkImage> image) : m_image(image) 23 StaticBitmapImage::StaticBitmapImage(PassRefPtr<SkImage> image, bool hasSingleSe curityOrigin)
24 : m_image(image)
25 , m_isOriginClean(hasSingleSecurityOrigin)
24 { 26 {
25 ASSERT(m_image); 27 ASSERT(m_image);
26 } 28 }
27 29
28 StaticBitmapImage::~StaticBitmapImage() { } 30 StaticBitmapImage::~StaticBitmapImage() { }
29 31
30 IntSize StaticBitmapImage::size() const 32 IntSize StaticBitmapImage::size() const
31 { 33 {
32 return IntSize(m_image->width(), m_image->height()); 34 return IntSize(m_image->width(), m_image->height());
33 } 35 }
(...skipping 24 matching lines...) Expand all
58 if (ImageObserver* observer = imageObserver()) 60 if (ImageObserver* observer = imageObserver())
59 observer->didDraw(this); 61 observer->didDraw(this);
60 } 62 }
61 63
62 PassRefPtr<SkImage> StaticBitmapImage::imageForCurrentFrame() 64 PassRefPtr<SkImage> StaticBitmapImage::imageForCurrentFrame()
63 { 65 {
64 return m_image; 66 return m_image;
65 } 67 }
66 68
67 } // namespace blink 69 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698