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

Unified Diff: chrome/browser/android/vr_shell/textures/ui_texture.cc

Issue 2834543006: Hook up insecure content warnings for http webVR presentation. (Closed)
Patch Set: Add missing files Created 3 years, 8 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: chrome/browser/android/vr_shell/textures/ui_texture.cc
diff --git a/chrome/browser/android/vr_shell/textures/ui_texture.cc b/chrome/browser/android/vr_shell/textures/ui_texture.cc
index 7cac42d2d92dc001543e0081e4afe4aa18733ab4..426dff76e0bac9e6c2045aaed9eb88c97575c513 100644
--- a/chrome/browser/android/vr_shell/textures/ui_texture.cc
+++ b/chrome/browser/android/vr_shell/textures/ui_texture.cc
@@ -25,35 +25,15 @@ namespace {
constexpr char kDefaultFontFamily[] = "sans-serif";
} // namespace
-// TODO(acondor): Create non-square textures to reduce memory usage.
-UITexture::UITexture(int texture_handle, int texture_size)
- : texture_handle_(texture_handle),
- texture_size_(texture_size),
- surface_(SkSurface::MakeRasterN32Premul(texture_size_, texture_size_)) {}
+UITexture::UITexture() = default;
UITexture::~UITexture() = default;
-void UITexture::DrawAndLayout() {
- cc::SkiaPaintCanvas paint_canvas(surface_->getCanvas());
- gfx::Canvas canvas(&paint_canvas, 1.0f);
- canvas.DrawColor(0x00000000);
- Draw(&canvas);
- SetSize();
-}
-
-void UITexture::Flush() {
- cc::SkiaPaintCanvas paint_canvas(surface_->getCanvas());
- paint_canvas.flush();
- SkPixmap pixmap;
- CHECK(surface_->peekPixels(&pixmap));
-
- glBindTexture(GL_TEXTURE_2D, texture_handle_);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, pixmap.width(), pixmap.height(), 0,
- GL_RGBA, GL_UNSIGNED_BYTE, pixmap.addr());
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+void UITexture::DrawAndLayout(SkCanvas* canvas, const gfx::Size& texture_size) {
+ cc::SkiaPaintCanvas paint_canvas(canvas);
+ gfx::Canvas gfx_canvas(&paint_canvas, 1.0f);
+ gfx_canvas.DrawColor(0x00000000);
cjgrant 2017/04/21 14:30:13 SK_ColorTRANSPARENT
mthiesse 2017/04/21 15:05:12 Done.
+ Draw(&gfx_canvas, texture_size);
}
bool UITexture::IsRTL() {

Powered by Google App Engine
This is Rietveld 408576698