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

Side by Side Diff: content/common/gpu/client/offscreen_context.h

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Put OffscreenContext class in content/common/gpu/client for renderer Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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 CONTENT_COMMON_GPU_CLIENT_OFFSCREEN_CONTEXT_H_
6 #define CONTENT_COMMON_GPU_CLIENT_OFFSCREEN_CONTEXT_H_
7
8 #include "skia/ext/refptr.h"
9
10 class GrContext;
11 namespace WebKit { class WebGraphicsContext3D; }
12
13 namespace content {
14
15 // This class lazily creates an offscreen GrContext that is bound to an
16 // offscreen context lazily created by its subclass implementation.
17 class OffscreenContext {
18 public:
19 OffscreenContext();
20 virtual ~OffscreenContext();
21
22 virtual WebKit::WebGraphicsContext3D* Context3d() = 0;
23 class GrContext* GrContext();
24
25 protected:
26 void SetGaneshContextMemoryLimit(bool nonzero_allocation);
27 void DidLoseContext();
28
29 private:
30 // The limit of the number of textures we hold in the GrContext's
31 // bitmap->texture cache.
32 static const int kMaxGaneshTextureCacheCount = 2048;
33 // The limit of the bytes allocated toward textures in the GrContext's
34 // bitmap->texture cache.
35 static const size_t kMaxGaneshTextureCacheBytes = 96 * 1024 * 1024;
36
37 skia::RefPtr<class GrContext> gr_context_;
38 };
39
40 } // namespace content
41
42 #endif // CONTENT_COMMON_GPU_CLIENT_OFFSCREEN_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698