OLD | NEW |
(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_ |
OLD | NEW |