|
|
Chromium Code Reviews|
Created:
4 years, 4 months ago by robertphillips Modified:
4 years, 4 months ago Reviewers:
egdaniel CC:
reviews_skia.org Base URL:
https://skia.googlesource.com/skia.git@master Target Ref:
refs/heads/master Project:
skia Visibility:
Public. |
DescriptionRemove GrRenderTarget member variable from SkGpuDevice
Split out of: https://codereview.chromium.org/2176333002/ (Remove SkSurface::MakeRenderTargetDirect)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208483004
Committed: https://skia.googlesource.com/skia/+/714712bfc9cff595f784969985e32c83a0e9c194
Patch Set 1 #
Total comments: 4
Patch Set 2 : Address code review comments #Patch Set 3 : update to ToT #
Messages
Total messages: 28 (21 generated)
Description was changed from ========== Remove GrRenderTarget member variable from SkGpuDevice ========== to ========== Remove GrRenderTarget member variable from SkGpuDevice GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208483004 ==========
Description was changed from ========== Remove GrRenderTarget member variable from SkGpuDevice GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208483004 ========== to ========== Remove GrRenderTarget member variable from SkGpuDevice Split out of: https://codereview.chromium.org/2176333002/ (Remove SkSurface::MakeRenderTargetDirect) GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208483004 ==========
robertphillips@google.com changed reviewers: + egdaniel@google.com
The CQ bit was checked by robertphillips@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm with one nit https://codereview.chromium.org/2208483004/diff/1/src/gpu/GrDrawContext.cpp File src/gpu/GrDrawContext.cpp (right): https://codereview.chromium.org/2208483004/diff/1/src/gpu/GrDrawContext.cpp#n... src/gpu/GrDrawContext.cpp:1223: if (fDrawContext->fDrawingManager->wasAbandoned()) { can we just do fDrawContext->wasAbandoned()? https://codereview.chromium.org/2208483004/diff/1/src/gpu/SkGpuDevice.cpp File src/gpu/SkGpuDevice.cpp (right): https://codereview.chromium.org/2208483004/diff/1/src/gpu/SkGpuDevice.cpp#new... src/gpu/SkGpuDevice.cpp:295: if (fDrawContext->wasAbandoned()) { is there an actual difference in what abandoned vs destroyed means here?
https://codereview.chromium.org/2208483004/diff/1/src/gpu/GrDrawContext.cpp File src/gpu/GrDrawContext.cpp (right): https://codereview.chromium.org/2208483004/diff/1/src/gpu/GrDrawContext.cpp#n... src/gpu/GrDrawContext.cpp:1223: if (fDrawContext->fDrawingManager->wasAbandoned()) { On 2016/08/03 19:55:06, egdaniel wrote: > can we just do fDrawContext->wasAbandoned()? Done. https://codereview.chromium.org/2208483004/diff/1/src/gpu/SkGpuDevice.cpp File src/gpu/SkGpuDevice.cpp (right): https://codereview.chromium.org/2208483004/diff/1/src/gpu/SkGpuDevice.cpp#new... src/gpu/SkGpuDevice.cpp:295: if (fDrawContext->wasAbandoned()) { On 2016/08/03 19:55:06, egdaniel wrote: > is there an actual difference in what abandoned vs destroyed means here? The two (public) ways to get into the GrGpuResource-destroyed state are: GrContext::abandonContext and GrContext::releaseResourcesAndAbandonContext. In both cases the drawingMgr is abandoned first.
The CQ bit was checked by robertphillips@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by robertphillips@google.com
The patchset sent to the CQ was uploaded after l-g-t-m from egdaniel@google.com Link to the patchset: https://codereview.chromium.org/2208483004/#ps20001 (title: "Address code review comments")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for src/gpu/SkGpuDevice.cpp:
While running git apply --index -3 -p1;
error: patch failed: src/gpu/SkGpuDevice.cpp:9
Falling back to three-way merge...
Applied patch to 'src/gpu/SkGpuDevice.cpp' with conflicts.
U src/gpu/SkGpuDevice.cpp
Patch: src/gpu/SkGpuDevice.cpp
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index
72718192692447d45a89c9ce85a43161c612484f..858b34b75117ee4282805c4af9263bf7d44c2351
100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -9,13 +9,15 @@
#include "GrBlurUtils.h"
#include "GrContext.h"
-#include "SkDraw.h"
+#include "GrDrawContextPriv.h"
#include "GrGpu.h"
#include "GrGpuResourcePriv.h"
#include "GrImageIDTextureAdjuster.h"
#include "GrStyle.h"
#include "GrTracing.h"
+
#include "SkCanvasPriv.h"
+#include "SkDraw.h"
#include "SkErrorInternals.h"
#include "SkGlyphCache.h"
#include "SkGr.h"
@@ -144,7 +146,6 @@ sk_sp<SkGpuDevice> SkGpuDevice::Make(GrContext* context,
SkBudgeted budgeted,
SkGpuDevice::SkGpuDevice(sk_sp<GrDrawContext> drawContext, int width, int
height, unsigned flags)
: INHERITED(drawContext->surfaceProps())
, fContext(SkRef(drawContext->accessRenderTarget()->getContext()))
- , fRenderTarget(drawContext->renderTarget())
, fDrawContext(std::move(drawContext)) {
fSize.set(width, height);
fOpaque = SkToBool(flags & kIsOpaque_Flag);
@@ -226,8 +227,10 @@ bool SkGpuDevice::onReadPixels(const SkImageInfo& dstInfo,
void* dstPixels, size
if (kUnpremul_SkAlphaType == dstInfo.alphaType()) {
flags = GrContext::kUnpremul_PixelOpsFlag;
}
- return fRenderTarget->readPixels(x, y, dstInfo.width(), dstInfo.height(),
config, dstPixels,
- dstRowBytes, flags);
+ return fDrawContext->accessRenderTarget()->readPixels(x, y,
+ dstInfo.width(),
dstInfo.height(),
+ config, dstPixels,
+ dstRowBytes, flags);
}
bool SkGpuDevice::onWritePixels(const SkImageInfo& info, const void* pixels,
size_t rowBytes,
@@ -242,8 +245,8 @@ bool SkGpuDevice::onWritePixels(const SkImageInfo& info,
const void* pixels, siz
if (kUnpremul_SkAlphaType == info.alphaType()) {
flags = GrContext::kUnpremul_PixelOpsFlag;
}
- fRenderTarget->writePixels(x, y, info.width(), info.height(), config,
pixels, rowBytes, flags);
-
+ fDrawContext->accessRenderTarget()->writePixels(x, y, info.width(),
info.height(),
+ config, pixels, rowBytes,
flags);
return true;
}
@@ -276,7 +279,7 @@ void SkGpuDevice::clearAll() {
void SkGpuDevice::replaceDrawContext(bool shouldRetainContent) {
ASSERT_SINGLE_OWNER
- SkBudgeted budgeted = fRenderTarget->resourcePriv().isBudgeted();
+ SkBudgeted budgeted = fDrawContext->drawContextPriv().isBudgeted();
sk_sp<GrDrawContext> newDC(MakeDrawContext(this->context(),
budgeted,
@@ -289,7 +292,7 @@ void SkGpuDevice::replaceDrawContext(bool
shouldRetainContent) {
}
if (shouldRetainContent) {
- if (fRenderTarget->wasDestroyed()) {
+ if (fDrawContext->wasAbandoned()) {
return;
}
newDC->copySurface(fDrawContext->asTexture().get(),
@@ -297,10 +300,6 @@ void SkGpuDevice::replaceDrawContext(bool
shouldRetainContent) {
SkIPoint::Make(0, 0));
}
- SkASSERT(fDrawContext->accessRenderTarget() !=
newDC->accessRenderTarget());
-
- fRenderTarget = newDC->renderTarget();
-
fDrawContext = newDC;
}
The CQ bit was checked by robertphillips@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by robertphillips@google.com
The patchset sent to the CQ was uploaded after l-g-t-m from egdaniel@google.com Link to the patchset: https://codereview.chromium.org/2208483004/#ps40001 (title: "update to ToT")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Remove GrRenderTarget member variable from SkGpuDevice Split out of: https://codereview.chromium.org/2176333002/ (Remove SkSurface::MakeRenderTargetDirect) GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208483004 ========== to ========== Remove GrRenderTarget member variable from SkGpuDevice Split out of: https://codereview.chromium.org/2176333002/ (Remove SkSurface::MakeRenderTargetDirect) GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208483004 Committed: https://skia.googlesource.com/skia/+/714712bfc9cff595f784969985e32c83a0e9c194 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://skia.googlesource.com/skia/+/714712bfc9cff595f784969985e32c83a0e9c194 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
