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

Side by Side Diff: sky/viewer/compositor/rasterizer_ganesh.cc

Issue 1213683004: Move //sky/compositor to //sky/viewer/compositor (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « sky/viewer/compositor/rasterizer_ganesh.h ('k') | sky/viewer/compositor/resource_manager.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 "sky/compositor/rasterizer_ganesh.h" 5 #include "sky/viewer/compositor/rasterizer_ganesh.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "mojo/skia/ganesh_surface.h" 8 #include "mojo/skia/ganesh_surface.h"
9 #include "sky/compositor/layer_host.h" 9 #include "sky/viewer/compositor/layer_host.h"
10 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
11 #include "third_party/skia/include/core/SkPicture.h" 11 #include "third_party/skia/include/core/SkPicture.h"
12 12
13 namespace sky { 13 namespace sky {
14 14
15 RasterizerGanesh::RasterizerGanesh(LayerHost* host) : host_(host) { 15 RasterizerGanesh::RasterizerGanesh(LayerHost* host) : host_(host) {
16 DCHECK(host_); 16 DCHECK(host_);
17 } 17 }
18 18
19 RasterizerGanesh::~RasterizerGanesh() { 19 RasterizerGanesh::~RasterizerGanesh() {
20 } 20 }
21 21
22 scoped_ptr<mojo::GLTexture> RasterizerGanesh::Rasterize(SkPicture* picture) { 22 scoped_ptr<mojo::GLTexture> RasterizerGanesh::Rasterize(SkPicture* picture) {
23 TRACE_EVENT0("sky", "RasterizerGanesh::Rasterize"); 23 TRACE_EVENT0("sky", "RasterizerGanesh::Rasterize");
24 24
25 SkRect cull_rect = picture->cullRect(); 25 SkRect cull_rect = picture->cullRect();
26 gfx::Size size(cull_rect.width(), cull_rect.height()); 26 gfx::Size size(cull_rect.width(), cull_rect.height());
27 27
28 mojo::GaneshSurface surface(host_->ganesh_context(), 28 mojo::GaneshSurface surface(host_->ganesh_context(),
29 host_->resource_manager()->CreateTexture(size)); 29 host_->resource_manager()->CreateTexture(size));
30 30
31 SkCanvas* canvas = surface.canvas(); 31 SkCanvas* canvas = surface.canvas();
32 canvas->drawPicture(picture); 32 canvas->drawPicture(picture);
33 canvas->flush(); 33 canvas->flush();
34 34
35 return surface.TakeTexture(); 35 return surface.TakeTexture();
36 } 36 }
37 37
38 } // namespace sky 38 } // namespace sky
OLDNEW
« no previous file with comments | « sky/viewer/compositor/rasterizer_ganesh.h ('k') | sky/viewer/compositor/resource_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698