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

Unified Diff: examples/ganesh_app/ganesh_view.cc

Issue 1518793004: Improve GL bindings for Ganesh surfaces. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address review comments Created 5 years 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
« no previous file with comments | « no previous file | mojo/skia/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/ganesh_app/ganesh_view.cc
diff --git a/examples/ganesh_app/ganesh_view.cc b/examples/ganesh_app/ganesh_view.cc
index e52a89cae4497e1286f59aabcacd52d52146375e..48075489764945f524d8cba2d1280d17afb30241 100644
--- a/examples/ganesh_app/ganesh_view.cc
+++ b/examples/ganesh_app/ganesh_view.cc
@@ -6,7 +6,7 @@
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
-#include "mojo/skia/ganesh_surface.h"
+#include "mojo/skia/ganesh_texture_surface.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -64,9 +64,9 @@ void GaneshView::OnViewBoundsChanged(mojo::View* view,
void GaneshView::Draw(const mojo::Size& size) {
TRACE_EVENT0("ganesh_app", __func__);
mojo::GaneshContext::Scope scope(gr_context_.get());
- mojo::GaneshSurface surface(
+ mojo::GaneshTextureSurface surface(
gr_context_.get(),
- make_scoped_ptr(new mojo::GLTexture(gl_context_, size)));
+ std::unique_ptr<mojo::GLTexture>(new mojo::GLTexture(gl_context_, size)));
SkCanvas* canvas = surface.canvas();
canvas->clear(SK_ColorCYAN);
@@ -83,7 +83,8 @@ void GaneshView::Draw(const mojo::Size& size) {
canvas->flush();
- texture_uploader_.Upload(surface.TakeTexture());
+ texture_uploader_.Upload(
+ scoped_ptr<mojo::GLTexture>(surface.TakeTexture().release()));
}
} // namespace examples
« no previous file with comments | « no previous file | mojo/skia/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698