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

Unified Diff: webkit/gpu/grcontext_for_webgraphicscontext3d.cc

Issue 16046003: Move webkit/gpu into webkit/common/gpu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix includes in content/common/gpu/client/gl_helper_* Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/gpu/grcontext_for_webgraphicscontext3d.h ('k') | webkit/gpu/test_context_provider_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/gpu/grcontext_for_webgraphicscontext3d.cc
diff --git a/webkit/gpu/grcontext_for_webgraphicscontext3d.cc b/webkit/gpu/grcontext_for_webgraphicscontext3d.cc
deleted file mode 100644
index a1d3abd56da2a154e555b485e2e0f36d0680bbf6..0000000000000000000000000000000000000000
--- a/webkit/gpu/grcontext_for_webgraphicscontext3d.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "webkit/gpu/grcontext_for_webgraphicscontext3d.h"
-
-#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
-#include "third_party/skia/include/gpu/GrContext.h"
-#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
-
-namespace webkit {
-namespace gpu {
-
-static void BindWebGraphicsContext3DGLContextCallback(
- const GrGLInterface* interface) {
- reinterpret_cast<WebKit::WebGraphicsContext3D*>(
- interface->fCallbackData)->makeContextCurrent();
-}
-
-GrContextForWebGraphicsContext3D::GrContextForWebGraphicsContext3D(
- WebKit::WebGraphicsContext3D* context3d) {
- if (!context3d)
- return;
-
- skia::RefPtr<GrGLInterface> interface = skia::AdoptRef(
- context3d->createGrGLInterface());
- if (!interface)
- return;
-
- interface->fCallback = BindWebGraphicsContext3DGLContextCallback;
- interface->fCallbackData =
- reinterpret_cast<GrGLInterfaceCallbackData>(context3d);
-
- gr_context_ = skia::AdoptRef(GrContext::Create(
- kOpenGL_GrBackend,
- reinterpret_cast<GrBackendContext>(interface.get())));
- if (!gr_context_)
- return;
-
- bool nonzero_allocation = true;
- SetMemoryLimit(nonzero_allocation);
-}
-
-GrContextForWebGraphicsContext3D::~GrContextForWebGraphicsContext3D() {
- if (gr_context_)
- gr_context_->contextDestroyed();
-}
-
-void GrContextForWebGraphicsContext3D::SetMemoryLimit(bool nonzero_allocation) {
- if (!gr_context_)
- return;
-
- if (nonzero_allocation) {
- // The limit of the number of textures we hold in the GrContext's
- // bitmap->texture cache.
- static const int kMaxGaneshTextureCacheCount = 2048;
- // The limit of the bytes allocated toward textures in the GrContext's
- // bitmap->texture cache.
- static const size_t kMaxGaneshTextureCacheBytes = 96 * 1024 * 1024;
-
- gr_context_->setTextureCacheLimits(
- kMaxGaneshTextureCacheCount, kMaxGaneshTextureCacheBytes);
- } else {
- gr_context_->freeGpuResources();
- gr_context_->setTextureCacheLimits(0, 0);
- }
-}
-
-} // namespace gpu
-} // namespace webkit
« no previous file with comments | « webkit/gpu/grcontext_for_webgraphicscontext3d.h ('k') | webkit/gpu/test_context_provider_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698