summaryrefslogtreecommitdiffstats
path: root/cc/resource_pool.cc
diff options
context:
space:
mode:
authorreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 16:39:24 +0000
committerreveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 16:39:24 +0000
commit5cc6e87c074e57fb3dfa6053e563872b9c5a08f9 (patch)
tree3eb85476da2eeee4ef17053caae16a2d7be84dea /cc/resource_pool.cc
parentdb9d45a5f52c126f7f414d7531ccd40cd6e2d313 (diff)
downloadchromium_src-5cc6e87c074e57fb3dfa6053e563872b9c5a08f9.zip
chromium_src-5cc6e87c074e57fb3dfa6053e563872b9c5a08f9.tar.gz
chromium_src-5cc6e87c074e57fb3dfa6053e563872b9c5a08f9.tar.bz2
cc: Implement impl-side rasterization.
Posts raster jobs on a worker thread and use pixel buffer API to avoid unnecessary copying. BUG=161338 Review URL: https://codereview.chromium.org/11417046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resource_pool.cc')
-rw-r--r--cc/resource_pool.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/cc/resource_pool.cc b/cc/resource_pool.cc
new file mode 100644
index 0000000..24c3755
--- /dev/null
+++ b/cc/resource_pool.cc
@@ -0,0 +1,30 @@
+// Copyright 2012 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 "cc/resource_pool.h"
+
+#include "cc/resource_provider.h"
+
+namespace cc {
+
+ResourcePool::ResourcePool(ResourceProvider* resource_provider,
+ Renderer::ResourcePool pool_id)
+ : resource_provider_(resource_provider),
+ pool_id_(pool_id) {
+}
+
+ResourcePool::~ResourcePool() {
+}
+
+ResourceProvider::ResourceId ResourcePool::AcquireResource(
+ const gfx::Size& size, GLenum format) {
+ return resource_provider_->createResource(
+ pool_id_, size, format, ResourceProvider::TextureUsageAny);
+}
+
+void ResourcePool::ReleaseResource(ResourceProvider::ResourceId resource_id) {
+ resource_provider_->deleteResource(resource_id);
+}
+
+} // namespace cc