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

Side by Side Diff: media/blink/webmediaplayer_cast_android.cc

Issue 2066323002: Remove SK_SUPPORT_LEGACY_TYPEFACE_PTR (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Mac fixes Created 4 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "media/blink/webmediaplayer_cast_android.h" 5 #include "media/blink/webmediaplayer_cast_android.h"
6 6
7 #include "gpu/GLES2/gl2extchromium.h" 7 #include "gpu/GLES2/gl2extchromium.h"
8 #include "gpu/command_buffer/client/gles2_interface.h" 8 #include "gpu/command_buffer/client/gles2_interface.h"
9 #include "gpu/command_buffer/common/sync_token.h" 9 #include "gpu/command_buffer/common/sync_token.h"
10 #include "media/base/android/media_common_android.h" 10 #include "media/base/android/media_common_android.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 SkCanvas canvas(bitmap); 60 SkCanvas canvas(bitmap);
61 canvas.drawColor(SK_ColorBLACK); 61 canvas.drawColor(SK_ColorBLACK);
62 62
63 const SkScalar kTextSize(40); 63 const SkScalar kTextSize(40);
64 const SkScalar kMinPadding(40); 64 const SkScalar kMinPadding(40);
65 65
66 SkPaint paint; 66 SkPaint paint;
67 paint.setAntiAlias(true); 67 paint.setAntiAlias(true);
68 paint.setFilterQuality(kHigh_SkFilterQuality); 68 paint.setFilterQuality(kHigh_SkFilterQuality);
69 paint.setColor(SK_ColorWHITE); 69 paint.setColor(SK_ColorWHITE);
70 paint.setTypeface(SkTypeface::CreateFromName("sans", SkTypeface::kBold)); 70 paint.setTypeface(SkTypeface::MakeFromName(
71 "sans", SkFontStyle::FromOldStyle(SkTypeface::kBold)));
71 paint.setTextSize(kTextSize); 72 paint.setTextSize(kTextSize);
72 73
73 // Calculate the vertical margin from the top 74 // Calculate the vertical margin from the top
74 SkPaint::FontMetrics font_metrics; 75 SkPaint::FontMetrics font_metrics;
75 paint.getFontMetrics(&font_metrics); 76 paint.getFontMetrics(&font_metrics);
76 SkScalar sk_vertical_margin = kMinPadding - font_metrics.fAscent; 77 SkScalar sk_vertical_margin = kMinPadding - font_metrics.fAscent;
77 78
78 // Measure the width of the entire text to display 79 // Measure the width of the entire text to display
79 size_t display_text_width = paint.measureText(remote_playback_message.c_str(), 80 size_t display_text_width = paint.measureText(remote_playback_message.c_str(),
80 remote_playback_message.size()); 81 remote_playback_message.size());
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 return MakeTextFrameForCast(remote_playback_message_, canvas_size, 380 return MakeTextFrameForCast(remote_playback_message_, canvas_size,
380 webmediaplayer_->naturalSize(), 381 webmediaplayer_->naturalSize(),
381 base::Bind(&GLCBShim, context_3d_cb_)); 382 base::Bind(&GLCBShim, context_3d_cb_));
382 } 383 }
383 384
384 void WebMediaPlayerCast::setPoster(const blink::WebURL& poster) { 385 void WebMediaPlayerCast::setPoster(const blink::WebURL& poster) {
385 player_manager_->SetPoster(player_id_, poster); 386 player_manager_->SetPoster(player_id_, poster);
386 } 387 }
387 388
388 } // namespace media 389 } // namespace media
OLDNEW
« no previous file with comments | « chrome/browser/ui/extensions/icon_with_badge_image_source.cc ('k') | skia/config/SkUserConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698