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

Unified Diff: cc/resource.cc

Issue 12471007: Part 8 of cc/ directory shuffles: resources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | « cc/resource.h ('k') | cc/resource_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resource.cc
diff --git a/cc/resource.cc b/cc/resource.cc
deleted file mode 100644
index 1fca7d756ced323448f3f4fed55be3c555f80d08..0000000000000000000000000000000000000000
--- a/cc/resource.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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.h"
-#include "third_party/khronos/GLES2/gl2ext.h"
-
-namespace cc {
-
-void Resource::set_dimensions(const gfx::Size& size, GLenum format) {
- size_ = size;
- format_ = format;
-}
-
-size_t Resource::bytes() const {
- if (size_.IsEmpty())
- return 0;
-
- return MemorySizeBytes(size_, format_);
-}
-
-size_t Resource::BytesPerPixel(GLenum format) {
- size_t components_per_pixel = 0;
- size_t bytes_per_component = 1;
- switch (format) {
- case GL_RGBA:
- case GL_BGRA_EXT:
- components_per_pixel = 4;
- break;
- case GL_LUMINANCE:
- components_per_pixel = 1;
- break;
- default:
- NOTREACHED();
- }
- return components_per_pixel * bytes_per_component;
-}
-
-size_t Resource::MemorySizeBytes(const gfx::Size& size, GLenum format) {
- return BytesPerPixel(format) * size.width() * size.height();
-}
-
-
-} // namespace cc
« no previous file with comments | « cc/resource.h ('k') | cc/resource_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698