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

Side by Side Diff: mojo/ui/ganesh_renderer.cc

Issue 1776643004: Mozart: Specify texture origin explicitly. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-3
Patch Set: Created 4 years, 9 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
« no previous file with comments | « mojo/skia/ganesh_image_factory.cc ('k') | mojo/ui/gl_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mojo/ui/ganesh_renderer.h" 5 #include "mojo/ui/ganesh_renderer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "mojo/gpu/gl_texture.h" 9 #include "mojo/gpu/gl_texture.h"
10 #include "mojo/skia/ganesh_context.h" 10 #include "mojo/skia/ganesh_context.h"
(...skipping 20 matching lines...) Expand all
31 31
32 { 32 {
33 mojo::skia::GaneshContext::Scope scope(ganesh_context_); 33 mojo::skia::GaneshContext::Scope scope(ganesh_context_);
34 mojo::skia::GaneshTextureSurface texture_surface(scope, std::move(texture)); 34 mojo::skia::GaneshTextureSurface texture_surface(scope, std::move(texture));
35 35
36 callback.Run(texture_surface.surface()); 36 callback.Run(texture_surface.surface());
37 37
38 texture = texture_surface.TakeTexture(); 38 texture = texture_surface.TakeTexture();
39 } 39 }
40 40
41 return gl_renderer_.BindTextureResource(std::move(texture)); 41 return gl_renderer_.BindTextureResource(
42 std::move(texture),
43 mojo::gfx::composition::MailboxTextureResource::Origin::TOP_LEFT);
42 } 44 }
43 45
44 static void RunCanvasCallback( 46 static void RunCanvasCallback(
45 const mojo::ui::GaneshRenderer::DrawCanvasCallback& callback, 47 const mojo::ui::GaneshRenderer::DrawCanvasCallback& callback,
46 SkSurface* surface) { 48 SkSurface* surface) {
47 callback.Run(surface->getCanvas()); 49 callback.Run(surface->getCanvas());
48 } 50 }
49 51
50 mojo::gfx::composition::ResourcePtr GaneshRenderer::DrawCanvas( 52 mojo::gfx::composition::ResourcePtr GaneshRenderer::DrawCanvas(
51 const mojo::Size& size, 53 const mojo::Size& size,
52 const DrawCanvasCallback& callback) { 54 const DrawCanvasCallback& callback) {
53 return DrawSurface(size, base::Bind(&RunCanvasCallback, callback)); 55 return DrawSurface(size, base::Bind(&RunCanvasCallback, callback));
54 } 56 }
55 57
56 } // namespace ui 58 } // namespace ui
57 } // namespace mojo 59 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/skia/ganesh_image_factory.cc ('k') | mojo/ui/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698