OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 | 8 |
10 #include "GrGpu.h" | 9 #include "GrGpu.h" |
11 | 10 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 return false; | 345 return false; |
347 } | 346 } |
348 | 347 |
349 bool GrGpu::transferPixels(GrSurface* surface, | 348 bool GrGpu::transferPixels(GrSurface* surface, |
350 int left, int top, int width, int height, | 349 int left, int top, int width, int height, |
351 GrPixelConfig config, GrTransferBuffer* buffer, | 350 GrPixelConfig config, GrTransferBuffer* buffer, |
352 size_t offset, size_t rowBytes) { | 351 size_t offset, size_t rowBytes) { |
353 SkASSERT(buffer); | 352 SkASSERT(buffer); |
354 | 353 |
355 this->handleDirtyContext(); | 354 this->handleDirtyContext(); |
356 if (this->onTransferPixels(surface, left, top, width, height, config, | 355 if (this->onTransferPixels(surface, left, top, width, height, config, |
357 buffer, offset, rowBytes)) { | 356 buffer, offset, rowBytes)) { |
358 fStats.incTransfersToTexture(); | 357 fStats.incTransfersToTexture(); |
359 return true; | 358 return true; |
360 } | 359 } |
361 return false; | 360 return false; |
362 } | 361 } |
363 | 362 |
364 void GrGpu::resolveRenderTarget(GrRenderTarget* target) { | 363 void GrGpu::resolveRenderTarget(GrRenderTarget* target) { |
365 SkASSERT(target); | 364 SkASSERT(target); |
366 this->handleDirtyContext(); | 365 this->handleDirtyContext(); |
367 this->onResolveRenderTarget(target); | 366 this->onResolveRenderTarget(target); |
368 } | 367 } |
369 | 368 |
370 //////////////////////////////////////////////////////////////////////////////// | 369 //////////////////////////////////////////////////////////////////////////////// |
371 | 370 |
372 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { | 371 void GrGpu::draw(const DrawArgs& args, const GrVertices& vertices) { |
373 this->handleDirtyContext(); | 372 this->handleDirtyContext(); |
374 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*this->c
aps())) { | 373 if (GrXferBarrierType barrierType = args.fPipeline->xferBarrierType(*this->c
aps())) { |
375 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType); | 374 this->xferBarrier(args.fPipeline->getRenderTarget(), barrierType); |
376 } | 375 } |
377 | 376 |
378 GrVertices::Iterator iter; | 377 GrVertices::Iterator iter; |
379 const GrNonInstancedVertices* verts = iter.init(vertices); | 378 const GrNonInstancedVertices* verts = iter.init(vertices); |
380 do { | 379 do { |
381 this->onDraw(args, *verts); | 380 this->onDraw(args, *verts); |
382 fStats.incNumDraws(); | 381 fStats.incNumDraws(); |
383 } while ((verts = iter.next())); | 382 } while ((verts = iter.next())); |
384 } | 383 } |
OLD | NEW |