| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 | 8 |
| 9 #include "GrGpu.h" | 9 #include "GrGpu.h" |
| 10 | 10 |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 size_t rowBytes) { | 392 size_t rowBytes) { |
| 393 GrMipLevel mipLevel; | 393 GrMipLevel mipLevel; |
| 394 mipLevel.fPixels = buffer; | 394 mipLevel.fPixels = buffer; |
| 395 mipLevel.fRowBytes = rowBytes; | 395 mipLevel.fRowBytes = rowBytes; |
| 396 SkSTArray<1, GrMipLevel> texels; | 396 SkSTArray<1, GrMipLevel> texels; |
| 397 texels.push_back(mipLevel); | 397 texels.push_back(mipLevel); |
| 398 | 398 |
| 399 return this->writePixels(surface, left, top, width, height, config, texels); | 399 return this->writePixels(surface, left, top, width, height, config, texels); |
| 400 } | 400 } |
| 401 | 401 |
| 402 bool GrGpu::transferPixels(GrSurface* surface, | 402 bool GrGpu::transferPixels(GrTexture* texture, |
| 403 int left, int top, int width, int height, | 403 int left, int top, int width, int height, |
| 404 GrPixelConfig config, GrBuffer* transferBuffer, | 404 GrPixelConfig config, GrBuffer* transferBuffer, |
| 405 size_t offset, size_t rowBytes) { | 405 size_t offset, size_t rowBytes, GrFence* fence) { |
| 406 SkASSERT(transferBuffer); | 406 SkASSERT(transferBuffer); |
| 407 | 407 |
| 408 this->handleDirtyContext(); | 408 this->handleDirtyContext(); |
| 409 if (this->onTransferPixels(surface, left, top, width, height, config, | 409 if (this->onTransferPixels(texture, left, top, width, height, config, |
| 410 transferBuffer, offset, rowBytes)) { | 410 transferBuffer, offset, rowBytes)) { |
| 411 SkIRect rect = SkIRect::MakeXYWH(left, top, width, height); | 411 SkIRect rect = SkIRect::MakeXYWH(left, top, width, height); |
| 412 this->didWriteToSurface(surface, &rect); | 412 this->didWriteToSurface(texture, &rect); |
| 413 fStats.incTransfersToTexture(); | 413 fStats.incTransfersToTexture(); |
| 414 |
| 415 if (*fence) { |
| 416 this->deleteFence(*fence); |
| 417 } |
| 418 *fence = this->insertFence(); |
| 419 |
| 414 return true; | 420 return true; |
| 415 } | 421 } |
| 416 return false; | 422 return false; |
| 417 } | 423 } |
| 418 | 424 |
| 419 void GrGpu::resolveRenderTarget(GrRenderTarget* target) { | 425 void GrGpu::resolveRenderTarget(GrRenderTarget* target) { |
| 420 SkASSERT(target); | 426 SkASSERT(target); |
| 421 this->handleDirtyContext(); | 427 this->handleDirtyContext(); |
| 422 this->onResolveRenderTarget(target); | 428 this->onResolveRenderTarget(target); |
| 423 } | 429 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 // This doesn't have geometric meaning. We just need to define an orderi
ng for std::map. | 495 // This doesn't have geometric meaning. We just need to define an orderi
ng for std::map. |
| 490 if (a[i].x() != b[i].x()) { | 496 if (a[i].x() != b[i].x()) { |
| 491 return a[i].x() < b[i].x(); | 497 return a[i].x() < b[i].x(); |
| 492 } | 498 } |
| 493 if (a[i].y() != b[i].y()) { | 499 if (a[i].y() != b[i].y()) { |
| 494 return a[i].y() < b[i].y(); | 500 return a[i].y() < b[i].y(); |
| 495 } | 501 } |
| 496 } | 502 } |
| 497 return false; // Equal. | 503 return false; // Equal. |
| 498 } | 504 } |
| OLD | NEW |