aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-08-18 09:39:34 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-18 09:39:34 -0700
commit6617d509ab0b056c57952bb1ee04b4c94904284b (patch)
tree639d0a2a1efc3a24367f5c28c0a1f868c17f2c49 /src/gpu
parent81d92659cf809f301c57bcf56c3f93fbebde16e6 (diff)
Rename GPUAccelData to GrAccelData
This is calved off of (Add new API to allow layer hoisting/atlasing across picture piles - https://codereview.chromium.org/474623002/) R=bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/482773002
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrPictureUtils.cpp12
-rw-r--r--src/gpu/GrPictureUtils.h8
-rw-r--r--src/gpu/SkGpuDevice.cpp18
3 files changed, 19 insertions, 19 deletions
diff --git a/src/gpu/GrPictureUtils.cpp b/src/gpu/GrPictureUtils.cpp
index 6e3c6b7ef6..7295089e82 100644
--- a/src/gpu/GrPictureUtils.cpp
+++ b/src/gpu/GrPictureUtils.cpp
@@ -13,14 +13,14 @@
#include "SkPictureData.h"
#include "SkPicturePlayback.h"
-SkPicture::AccelData::Key GPUAccelData::ComputeAccelDataKey() {
+SkPicture::AccelData::Key GrAccelData::ComputeAccelDataKey() {
static const SkPicture::AccelData::Key gGPUID = SkPicture::AccelData::GenerateDomain();
return gGPUID;
}
// The GrGather device performs GPU-backend-specific preprocessing on
-// a picture. The results are stored in a GPUAccelData.
+// a picture. The results are stored in a GrAccelData.
//
// Currently the only interesting work is done in drawDevice (i.e., when a
// saveLayer is collapsed back into its parent) and, maybe, in onCreateDevice.
@@ -31,7 +31,7 @@ class GrGatherDevice : public SkBaseDevice {
public:
SK_DECLARE_INST_COUNT(GrGatherDevice)
- GrGatherDevice(int width, int height, SkPicturePlayback* playback, GPUAccelData* accelData,
+ GrGatherDevice(int width, int height, SkPicturePlayback* playback, GrAccelData* accelData,
int saveLayerDepth) {
fPlayback = playback;
fSaveLayerDepth = saveLayerDepth;
@@ -171,14 +171,14 @@ private:
SkBitmap fEmptyBitmap; // legacy -- need to remove
// All information gathered during the gather process is stored here
- GPUAccelData* fAccelData;
+ GrAccelData* fAccelData;
// true if this device has already been drawn back to its parent(s) at least
// once.
bool fAlreadyDrawn;
// The information regarding the saveLayer call this device represents.
- GPUAccelData::SaveLayerInfo fInfo;
+ GrAccelData::SaveLayerInfo fInfo;
// The depth of this device in the saveLayer stack
int fSaveLayerDepth;
@@ -259,7 +259,7 @@ private:
// GatherGPUInfo is only intended to be called within the context of SkGpuDevice's
// EXPERIMENTAL_optimize method.
-void GatherGPUInfo(const SkPicture* pict, GPUAccelData* accelData) {
+void GatherGPUInfo(const SkPicture* pict, GrAccelData* accelData) {
if (NULL == pict || 0 == pict->width() || 0 == pict->height()) {
return ;
}
diff --git a/src/gpu/GrPictureUtils.h b/src/gpu/GrPictureUtils.h
index a730697d62..46af12d2f1 100644
--- a/src/gpu/GrPictureUtils.h
+++ b/src/gpu/GrPictureUtils.h
@@ -13,7 +13,7 @@
// This class encapsulates the GPU-backend-specific acceleration data
// for a single SkPicture
-class GPUAccelData : public SkPicture::AccelData {
+class GrAccelData : public SkPicture::AccelData {
public:
// Information about a given saveLayer in an SkPicture
struct SaveLayerInfo {
@@ -43,9 +43,9 @@ public:
bool fIsNested;
};
- GPUAccelData(Key key) : INHERITED(key) { }
+ GrAccelData(Key key) : INHERITED(key) { }
- virtual ~GPUAccelData() {
+ virtual ~GrAccelData() {
for (int i = 0; i < fSaveLayerInfo.count(); ++i) {
SkDELETE(fSaveLayerInfo[i].fPaint);
}
@@ -74,6 +74,6 @@ private:
typedef SkPicture::AccelData INHERITED;
};
-void GatherGPUInfo(const SkPicture* pict, GPUAccelData* accelData);
+void GatherGPUInfo(const SkPicture* pict, GrAccelData* accelData);
#endif // GrPictureUtils_DEFINED
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 64439a1882..f2bd025a0f 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1854,14 +1854,14 @@ void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
return;
}
- SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey();
+ SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey();
const SkPicture::AccelData* existing = picture->EXPERIMENTAL_getAccelData(key);
if (NULL != existing) {
return;
}
- SkAutoTUnref<GPUAccelData> data(SkNEW_ARGS(GPUAccelData, (key)));
+ SkAutoTUnref<GrAccelData> data(SkNEW_ARGS(GrAccelData, (key)));
picture->EXPERIMENTAL_addAccelData(data);
@@ -1885,14 +1885,14 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
fContext->getLayerCache()->processDeletedPictures();
- SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey();
+ SkPicture::AccelData::Key key = GrAccelData::ComputeAccelDataKey();
const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key);
if (NULL == data) {
return false;
}
- const GPUAccelData *gpuData = static_cast<const GPUAccelData*>(data);
+ const GrAccelData *gpuData = static_cast<const GrAccelData*>(data);
if (0 == gpuData->numSaveLayers()) {
return false;
@@ -1925,11 +1925,11 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
for (int i = 0; i < ops->numOps(); ++i) {
uint32_t offset = ops->offset(i);
- // For now we're saving all the layers in the GPUAccelData so they
+ // For now we're saving all the layers in the GrAccelData so they
// can be nested. Additionally, the nested layers appear before
// their parent in the list.
for (int j = 0 ; j < gpuData->numSaveLayers(); ++j) {
- const GPUAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(j);
+ const GrAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(j);
if (pullForward[j]) {
continue; // already pulling forward
@@ -1955,7 +1955,7 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
// In this case there is no BBH associated with the picture. Pre-render
// all the layers that intersect the drawn region
for (int j = 0; j < gpuData->numSaveLayers(); ++j) {
- const GPUAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(j);
+ const GrAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(j);
SkIRect layerRect = SkIRect::MakeXYWH(info.fOffset.fX,
info.fOffset.fY,
@@ -1987,7 +1987,7 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
// Generate the layer and/or ensure it is locked
for (int i = 0; i < gpuData->numSaveLayers(); ++i) {
if (pullForward[i]) {
- const GPUAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(i);
+ const GrAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(i);
GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(picture->uniqueID(),
info.fSaveLayerOpID,
@@ -2125,7 +2125,7 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
// unlock the layers
for (int i = 0; i < gpuData->numSaveLayers(); ++i) {
- const GPUAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(i);
+ const GrAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(i);
GrCachedLayer* layer = fContext->getLayerCache()->findLayer(picture->uniqueID(),
info.fSaveLayerOpID,