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

Unified Diff: src/gpu/GrPictureUtils.cpp

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 6 years, 4 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
Index: src/gpu/GrPictureUtils.cpp
diff --git a/src/gpu/GrPictureUtils.cpp b/src/gpu/GrPictureUtils.cpp
index 7295089e821cefff413d55c425c69c082794c37b..854756e60d44b7913f9655061e19ba2752b0d490 100644
--- a/src/gpu/GrPictureUtils.cpp
+++ b/src/gpu/GrPictureUtils.cpp
@@ -237,7 +237,7 @@ protected:
virtual void onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
const SkPaint* paint) SK_OVERRIDE {
- SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->width(), picture->height());
+ SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect());
if (NULL != picture->fData.get()) {
// Disable the BBH for the old path so all the draw calls
@@ -260,7 +260,7 @@ private:
// GatherGPUInfo is only intended to be called within the context of SkGpuDevice's
// EXPERIMENTAL_optimize method.
void GatherGPUInfo(const SkPicture* pict, GrAccelData* accelData) {
- if (NULL == pict || 0 == pict->width() || 0 == pict->height()) {
+ if (NULL == pict || pict->cullRect().isEmpty()) {
return ;
}
@@ -269,11 +269,11 @@ void GatherGPUInfo(const SkPicture* pict, GrAccelData* accelData) {
SkPicturePlayback playback(pict);
playback.setUseBBH(false);
- GrGatherDevice device(pict->width(), pict->height(), &playback, accelData, 0);
+ GrGatherDevice device(SkScalarCeilToInt(pict->cullRect().width()),
+ SkScalarCeilToInt(pict->cullRect().height()),
+ &playback, accelData, 0);
GrGatherCanvas canvas(&device);
- canvas.clipRect(SkRect::MakeWH(SkIntToScalar(pict->width()),
- SkIntToScalar(pict->height())),
- SkRegion::kIntersect_Op, false);
+ canvas.clipRect(pict->cullRect(), SkRegion::kIntersect_Op, false);
playback.draw(&canvas, NULL);
}

Powered by Google App Engine
This is Rietveld 408576698