| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/android/vr_shell/textures/ui_texture.h" | 5 #include "chrome/browser/android/vr_shell/textures/ui_texture.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 bool UiTexture::SetDrawFlags(int draw_flags) { | 73 bool UiTexture::SetDrawFlags(int draw_flags) { |
| 74 if (draw_flags == draw_flags_) | 74 if (draw_flags == draw_flags_) |
| 75 return false; | 75 return false; |
| 76 draw_flags_ = draw_flags; | 76 draw_flags_ = draw_flags; |
| 77 return true; | 77 return true; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void UiTexture::DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size) { | 80 void UiTexture::DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size) { |
| 81 TRACE_EVENT0("gpu", "UiTexture::DrawAndLayout"); | 81 TRACE_EVENT0("gpu", "UiTexture::DrawAndLayout"); |
| 82 canvas->drawColor(SK_ColorTRANSPARENT); | 82 canvas->drawColor(SK_ColorTRANSPARENT); |
| 83 dirty_ = false; |
| 83 Draw(canvas, texture_size); | 84 Draw(canvas, texture_size); |
| 84 } | 85 } |
| 85 | 86 |
| 86 std::vector<std::unique_ptr<gfx::RenderText>> UiTexture::PrepareDrawStringRect( | 87 std::vector<std::unique_ptr<gfx::RenderText>> UiTexture::PrepareDrawStringRect( |
| 87 const base::string16& text, | 88 const base::string16& text, |
| 88 const gfx::FontList& font_list, | 89 const gfx::FontList& font_list, |
| 89 SkColor color, | 90 SkColor color, |
| 90 gfx::Rect* bounds, | 91 gfx::Rect* bounds, |
| 91 int flags) { | 92 int flags) { |
| 92 DCHECK(bounds); | 93 DCHECK(bounds); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 std::string name = GetFallbackFontNameForChar(default_font, c, ""); | 167 std::string name = GetFallbackFontNameForChar(default_font, c, ""); |
| 167 if (!name.empty()) | 168 if (!name.empty()) |
| 168 names.insert(name); | 169 names.insert(name); |
| 169 } | 170 } |
| 170 for (const auto& name : names) | 171 for (const auto& name : names) |
| 171 fonts.push_back(gfx::Font(name, size)); | 172 fonts.push_back(gfx::Font(name, size)); |
| 172 return gfx::FontList(fonts); | 173 return gfx::FontList(fonts); |
| 173 } | 174 } |
| 174 | 175 |
| 175 } // namespace vr_shell | 176 } // namespace vr_shell |
| OLD | NEW |