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

Side by Side Diff: gpu/skia_bindings/grcontext_for_gles2_interface.cc

Issue 2020013002: gpu: Increase Skia resource cache item limit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tiling-blit-from-msaa-surface
Patch Set: rebase Created 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 "gpu/skia_bindings/grcontext_for_gles2_interface.h" 5 #include "gpu/skia_bindings/grcontext_for_gles2_interface.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 11 matching lines...) Expand all
22 gpu::gles2::GLES2Interface* gl) { 22 gpu::gles2::GLES2Interface* gl) {
23 sk_sp<GrGLInterface> interface( 23 sk_sp<GrGLInterface> interface(
24 skia_bindings::CreateGLES2InterfaceBindings(gl)); 24 skia_bindings::CreateGLES2InterfaceBindings(gl));
25 gr_context_ = sk_sp<GrContext>( 25 gr_context_ = sk_sp<GrContext>(
26 GrContext::Create(kOpenGL_GrBackend, 26 GrContext::Create(kOpenGL_GrBackend,
27 // GrContext takes ownership of |interface|. 27 // GrContext takes ownership of |interface|.
28 reinterpret_cast<GrBackendContext>(interface.get()))); 28 reinterpret_cast<GrBackendContext>(interface.get())));
29 if (gr_context_) { 29 if (gr_context_) {
30 // The limit of the number of GPU resources we hold in the GrContext's 30 // The limit of the number of GPU resources we hold in the GrContext's
31 // GPU cache. 31 // GPU cache.
32 static const int kMaxGaneshResourceCacheCount = 2048; 32 static const int kMaxGaneshResourceCacheCount = 8196;
33 // The limit of the bytes allocated toward GPU resources in the GrContext's 33 // The limit of the bytes allocated toward GPU resources in the GrContext's
34 // GPU cache. 34 // GPU cache.
35 static const size_t kMaxGaneshResourceCacheBytes = 96 * 1024 * 1024; 35 static const size_t kMaxGaneshResourceCacheBytes = 96 * 1024 * 1024;
36 36
37 gr_context_->setResourceCacheLimits(kMaxGaneshResourceCacheCount, 37 gr_context_->setResourceCacheLimits(kMaxGaneshResourceCacheCount,
38 kMaxGaneshResourceCacheBytes); 38 kMaxGaneshResourceCacheBytes);
39 } 39 }
40 } 40 }
41 41
42 GrContextForGLES2Interface::~GrContextForGLES2Interface() { 42 GrContextForGLES2Interface::~GrContextForGLES2Interface() {
(...skipping 15 matching lines...) Expand all
58 58
59 void GrContextForGLES2Interface::FreeGpuResources() { 59 void GrContextForGLES2Interface::FreeGpuResources() {
60 if (gr_context_) { 60 if (gr_context_) {
61 TRACE_EVENT_INSTANT0("gpu", "GrContext::freeGpuResources", 61 TRACE_EVENT_INSTANT0("gpu", "GrContext::freeGpuResources",
62 TRACE_EVENT_SCOPE_THREAD); 62 TRACE_EVENT_SCOPE_THREAD);
63 gr_context_->freeGpuResources(); 63 gr_context_->freeGpuResources();
64 } 64 }
65 } 65 }
66 66
67 } // namespace skia_bindings 67 } // namespace skia_bindings
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698