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

Unified Diff: third_party/WebKit/Source/core/css/MediaValuesCached.cpp

Issue 2652313004: Implement color-gamut media query (Closed)
Patch Set: fix windows build Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/MediaValuesCached.cpp
diff --git a/third_party/WebKit/Source/core/css/MediaValuesCached.cpp b/third_party/WebKit/Source/core/css/MediaValuesCached.cpp
index c7cc9e072dfa23fbb864c55eb63cc267e9440f26..604177d4fc76c2b81818d90c32f1e384397bfd99 100644
--- a/third_party/WebKit/Source/core/css/MediaValuesCached.cpp
+++ b/third_party/WebKit/Source/core/css/MediaValuesCached.cpp
@@ -9,9 +9,29 @@
#include "core/frame/LocalFrame.h"
#include "core/layout/LayoutObject.h"
#include "core/layout/api/LayoutViewItem.h"
+#include "platform/graphics/ColorSpace.h"
namespace blink {
+MediaValuesCached::MediaValuesCachedData::MediaValuesCachedData()
+ : viewportWidth(0),
+ viewportHeight(0),
+ deviceWidth(0),
+ deviceHeight(0),
+ devicePixelRatio(1.0),
+ colorBitsPerComponent(24),
+ monochromeBitsPerComponent(0),
+ primaryPointerType(PointerTypeNone),
+ availablePointerTypes(PointerTypeNone),
+ primaryHoverType(HoverTypeNone),
+ availableHoverTypes(HoverTypeNone),
+ defaultFontSize(16),
+ threeDEnabled(false),
+ strictMode(true),
+ displayMode(WebDisplayModeBrowser),
+ displayShape(DisplayShapeRect),
+ colorGamut(ColorSpaceGamut::Unknown) {}
+
MediaValuesCached::MediaValuesCachedData::MediaValuesCachedData(
Document& document)
: MediaValuesCached::MediaValuesCachedData() {
@@ -44,6 +64,7 @@ MediaValuesCached::MediaValuesCachedData::MediaValuesCachedData(
displayMode = MediaValues::calculateDisplayMode(frame);
mediaType = MediaValues::calculateMediaType(frame);
displayShape = MediaValues::calculateDisplayShape(frame);
+ colorGamut = MediaValues::calculateColorGamut(frame);
}
}
@@ -159,4 +180,8 @@ DisplayShape MediaValuesCached::displayShape() const {
return m_data.displayShape;
}
+ColorSpaceGamut MediaValuesCached::colorGamut() const {
+ return m_data.colorGamut;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698