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

Unified Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.h

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ensure screen device profiles are matrix Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/BitmapImage.h
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.h b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
index a0b1e9d41b590f7a18c384a188cf8e805771b85b..f0d32da4d7c35775d99c41e7f3c28f9aefc67976 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.h
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
@@ -29,7 +29,6 @@
#define BitmapImage_h
#include "platform/geometry/IntSize.h"
-#include "platform/graphics/Color.h"
#include "platform/graphics/FrameData.h"
#include "platform/graphics/Image.h"
#include "platform/graphics/ImageAnimationPolicy.h"
@@ -54,23 +53,25 @@ public:
return adoptRef(new BitmapImage(observer));
}
- // This allows constructing a BitmapImage with a forced non-default orientation.
- static PassRefPtr<BitmapImage> createWithOrientationForTesting(const SkBitmap&, ImageOrientation);
-
~BitmapImage() override;
- bool isBitmapImage() const override;
+ bool isBitmapImage() const override { return true; };
- bool currentFrameHasSingleSecurityOrigin() const override;
+ bool currentFrameHasSingleSecurityOrigin() const override { return true; };
IntSize size() const override;
IntSize sizeRespectingOrientation() const;
bool getHotSpot(IntPoint&) const override;
String filenameExtension() const override;
- bool dataChanged(bool allDataReceived) override;
+ bool dataChanged(bool allDataReceived) override;
bool isAllDataReceived() const { return m_allDataReceived; }
+
bool hasColorProfile() const;
+ PassRefPtr<ColorSpaceProfile> colorProfile() const { return m_source.colorProfile(); }
+ void setDrawingToCanvasElement(bool status) { m_drawingToCanvasElement = status; } // FIXME: remove.
+ bool drawingToCanvasElement() { return m_drawingToCanvasElement; } // FIXME: remove.
+ PassRefPtr<SkColorFilter> imageColorTransform();
// It may look unusual that there's no start animation call as public API.
// This because we start and stop animating lazily. Animation starts when
@@ -84,17 +85,22 @@ public:
ImageAnimationPolicy animationPolicy() override { return m_animationPolicy; }
void advanceTime(double deltaTimeInSeconds) override;
- // Advance the image animation by one frame.
- void advanceAnimationForTesting() override { internalAdvanceAnimation(false); }
-
PassRefPtr<SkImage> imageForCurrentFrame() override;
PassRefPtr<Image> imageForDefaultFrame() override;
+
bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override;
bool currentFrameIsComplete() override;
bool currentFrameIsLazyDecoded() override;
+ // FIXME: consider renaming this to orientationForCurrentFrame(), or perhaps
+ // imageOrientation, since orientation is the same for all image frames.
ImageOrientation currentFrameOrientation();
+ // Construct a BitmapImage with the given orientation.
+ static PassRefPtr<BitmapImage> createWithOrientationForTesting(const SkBitmap&, ImageOrientation);
+ // Advance an animated image by one frame.
+ void advanceAnimationForTesting() override { internalAdvanceAnimation(false); }
+
private:
friend class BitmapImageTest;
@@ -111,6 +117,7 @@ private:
BitmapImage(ImageObserver* = 0);
void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) override;
+ void didDraw();
size_t currentFrame() const { return m_currentFrame; }
size_t frameCount();
@@ -191,6 +198,8 @@ private:
bool m_sizeAvailable : 1; // Whether or not we can obtain the size of the first image frame yet from ImageIO.
mutable bool m_hasUniformFrameSize : 1;
mutable bool m_haveFrameCount : 1;
+ // DEBUG: whether or not <canvas> is drawing this bitmap image. FIXME: remove.
+ mutable bool m_drawingToCanvasElement : 1;
};
DEFINE_IMAGE_TYPE_CASTS(BitmapImage);
« no previous file with comments | « third_party/WebKit/Source/platform/blink_platform.gypi ('k') | third_party/WebKit/Source/platform/graphics/BitmapImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698