OLD | NEW |
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 "content/renderer/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 | 1122 |
1123 // Create the canvas and draw the "Casting to <Chromecast>" text on it. | 1123 // Create the canvas and draw the "Casting to <Chromecast>" text on it. |
1124 SkCanvas canvas(bitmap); | 1124 SkCanvas canvas(bitmap); |
1125 canvas.drawColor(SK_ColorBLACK); | 1125 canvas.drawColor(SK_ColorBLACK); |
1126 | 1126 |
1127 const SkScalar kTextSize(40); | 1127 const SkScalar kTextSize(40); |
1128 const SkScalar kMinPadding(40); | 1128 const SkScalar kMinPadding(40); |
1129 | 1129 |
1130 SkPaint paint; | 1130 SkPaint paint; |
1131 paint.setAntiAlias(true); | 1131 paint.setAntiAlias(true); |
1132 paint.setFilterLevel(SkPaint::kHigh_FilterLevel); | 1132 paint.setFilterQuality(kHigh_SkFilterQuality); |
1133 paint.setColor(SK_ColorWHITE); | 1133 paint.setColor(SK_ColorWHITE); |
1134 paint.setTypeface(SkTypeface::CreateFromName("sans", SkTypeface::kBold)); | 1134 paint.setTypeface(SkTypeface::CreateFromName("sans", SkTypeface::kBold)); |
1135 paint.setTextSize(kTextSize); | 1135 paint.setTextSize(kTextSize); |
1136 | 1136 |
1137 // Calculate the vertical margin from the top | 1137 // Calculate the vertical margin from the top |
1138 SkPaint::FontMetrics font_metrics; | 1138 SkPaint::FontMetrics font_metrics; |
1139 paint.getFontMetrics(&font_metrics); | 1139 paint.getFontMetrics(&font_metrics); |
1140 SkScalar sk_vertical_margin = kMinPadding - font_metrics.fAscent; | 1140 SkScalar sk_vertical_margin = kMinPadding - font_metrics.fAscent; |
1141 | 1141 |
1142 // Measure the width of the entire text to display | 1142 // Measure the width of the entire text to display |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 | 1857 |
1858 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1858 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1859 std::string mime; | 1859 std::string mime; |
1860 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1860 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
1861 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1861 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
1862 return false; | 1862 return false; |
1863 return !mime.compare("application/x-mpegurl"); | 1863 return !mime.compare("application/x-mpegurl"); |
1864 } | 1864 } |
1865 | 1865 |
1866 } // namespace content | 1866 } // namespace content |
OLD | NEW |