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

Side by Side Diff: cc/resources/ganesh_rasterizer.h

Issue 69343005: Added preliminary support for tile rasterization with Ganesh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ported scissoring fix from gr_layer patch. Created 7 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_RESOURCES_GANESH_RASTERIZER_H_
6 #define CC_RESOURCES_GANESH_RASTERIZER_H_
7
8 #include "base/memory/scoped_vector.h"
9 #include "cc/resources/resource_pool.h"
10 #include "cc/resources/tile.h"
11
12 namespace cc {
13
14 class ContextProvider;
15 class ResourceProvider;
16 class RenderingStatsInstrumentation;
17
18 class GaneshRasterizerClient {
19 public:
20 virtual void OnGaneshRasterTaskCompleted(
21 Tile* tile, scoped_ptr<ResourcePool::Resource> resource,
22 bool was_canceled) = 0;
23 };
24
25 class GaneshRasterizer {
26 public:
27 class RasterTask;
28 typedef ScopedVector<RasterTask> RasterTaskVector;
29
30 static scoped_ptr<GaneshRasterizer> Create(
31 ContextProvider* context_provider,
32 ResourceProvider* resource_provider);
33 ~GaneshRasterizer();
34
35 void SetClient(GaneshRasterizerClient* client);
36
37 ResourceFormat GetResourceFormat() const { return BGRA_8888; }
38
39 RasterTask* CreateRasterTask(
40 Tile* tile, scoped_ptr<ResourcePool::Resource> resource);
41
42 void Rasterize(
43 RasterTaskVector& tasks,
44 RenderingStatsInstrumentation* rendering_stats_instrumentation);
45
46 class RasterTask {
47 public:
48 ~RasterTask() {}
49
50 private:
51 friend class GaneshRasterizer;
52
53 RasterTask(Tile* tile, scoped_ptr<ResourcePool::Resource> resource)
vmpstr 2013/11/22 21:29:12 I think this (and destructor) will have to be decl
slavi 2013/11/23 01:27:19 Good catch. Done.
54 : tile_(tile), resource_(resource.Pass()) {
55 }
56
57 Tile* tile_;
58 scoped_ptr<ResourcePool::Resource> resource_;
59 };
60
61 private:
62 GaneshRasterizer(
63 ContextProvider* context_provider,
64 ResourceProvider* resource_provider);
65
66 GaneshRasterizerClient* client_;
67 ContextProvider* context_provider_;
68 ResourceProvider* resource_provider_;
69 };
70
71 } // namespace cc
72
73 #endif // CC_RESOURCES_GANESH_RASTERIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698