summaryrefslogtreecommitdiffstats
path: root/cc/resource_provider.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-31 20:52:25 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-31 20:52:25 +0000
commitf809d3bb86532d666d6094497b5b7f93f3b32a9e (patch)
treee37a05eb364b08446fbdd4a11e77a79eabf48d02 /cc/resource_provider.h
parentd388fe22c8c1c6e80c990be37fe067634bfed7a9 (diff)
downloadchromium_src-f809d3bb86532d666d6094497b5b7f93f3b32a9e.zip
chromium_src-f809d3bb86532d666d6094497b5b7f93f3b32a9e.tar.gz
chromium_src-f809d3bb86532d666d6094497b5b7f93f3b32a9e.tar.bz2
Use gfx:: Geometry types for the resource provider and layer updater classes.
This depends on the gfx::Vector2d class from https://codereview.chromium.org/11269022/ Covered by existing tests, just changing data types. BUG=147395 R=enne Review URL: https://codereview.chromium.org/11266030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resource_provider.h')
-rw-r--r--cc/resource_provider.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/cc/resource_provider.h b/cc/resource_provider.h
index 3b66f9b..45b99eb 100644
--- a/cc/resource_provider.h
+++ b/cc/resource_provider.h
@@ -5,7 +5,6 @@
#ifndef CCResourceProvider_h
#define CCResourceProvider_h
-#include "IntSize.h"
#include "base/basictypes.h"
#include "base/hash_tables.h"
#include "base/memory/scoped_ptr.h"
@@ -14,6 +13,7 @@
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "ui/gfx/size.h"
#include <deque>
#include <vector>
@@ -21,9 +21,13 @@ namespace WebKit {
class WebGraphicsContext3D;
}
+namespace gfx {
+class Rect;
+class Vector2d;
+}
+
namespace cc {
-class IntRect;
class LayerTextureSubImage;
class TextureCopier;
class TextureUploader;
@@ -46,7 +50,7 @@ public:
struct TransferableResource {
unsigned id;
GLenum format;
- IntSize size;
+ gfx::Size size;
Mailbox mailbox;
};
typedef std::vector<TransferableResource> TransferableResourceArray;
@@ -78,11 +82,11 @@ public:
ResourceType resourceType(ResourceId);
// Creates a resource of the default resource type.
- ResourceId createResource(int pool, const IntSize&, GLenum format, TextureUsageHint);
+ ResourceId createResource(int pool, const gfx::Size&, GLenum format, TextureUsageHint);
// You can also explicitly create a specific resource type.
- ResourceId createGLTexture(int pool, const IntSize&, GLenum format, TextureUsageHint);
- ResourceId createBitmap(int pool, const IntSize&);
+ ResourceId createGLTexture(int pool, const gfx::Size&, GLenum format, TextureUsageHint);
+ ResourceId createBitmap(int pool, const gfx::Size&);
// Wraps an external texture into a GL resource.
ResourceId createResourceFromExternalTexture(unsigned textureId);
@@ -92,7 +96,7 @@ public:
void deleteOwnedResources(int pool);
// Upload data from image, copying sourceRect (in image) into destRect (in the resource).
- void upload(ResourceId, const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntSize& destOffset);
+ void upload(ResourceId, const uint8_t* image, const gfx::Rect& imageRect, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset);
// Check upload status.
size_t numBlockingUploads();
@@ -219,8 +223,8 @@ public:
private:
struct Resource {
Resource();
- Resource(unsigned textureId, int pool, const IntSize& size, GLenum format);
- Resource(uint8_t* pixels, int pool, const IntSize& size, GLenum format);
+ Resource(unsigned textureId, int pool, const gfx::Size& size, GLenum format);
+ Resource(uint8_t* pixels, int pool, const gfx::Size& size, GLenum format);
unsigned glId;
uint8_t* pixels;
@@ -230,7 +234,7 @@ private:
bool external;
bool exported;
bool markedForDeletion;
- IntSize size;
+ gfx::Size size;
GLenum format;
ResourceType type;
};