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

Side by Side Diff: src/gpu/GrGpu.h

Issue 2384463003: Add fence support for TransferBuffers (Closed)
Patch Set: Add test code Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 #ifndef GrGpu_DEFINED 8 #ifndef GrGpu_DEFINED
9 #define GrGpu_DEFINED 9 #define GrGpu_DEFINED
10 10
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 * @param height height of rectangle to write in pixels. 298 * @param height height of rectangle to write in pixels.
299 * @param config the pixel config of the source buffer 299 * @param config the pixel config of the source buffer
300 * @param transferBuffer GrBuffer to read pixels from (type must be "kCpuT oGpu") 300 * @param transferBuffer GrBuffer to read pixels from (type must be "kCpuT oGpu")
301 * @param offset offset from the start of the buffer 301 * @param offset offset from the start of the buffer
302 * @param rowBytes number of bytes between consecutive rows. Zero 302 * @param rowBytes number of bytes between consecutive rows. Zero
303 * means rows are tightly packed. 303 * means rows are tightly packed.
304 */ 304 */
305 bool transferPixels(GrSurface* surface, 305 bool transferPixels(GrSurface* surface,
306 int left, int top, int width, int height, 306 int left, int top, int width, int height,
307 GrPixelConfig config, GrBuffer* transferBuffer, 307 GrPixelConfig config, GrBuffer* transferBuffer,
308 size_t offset, size_t rowBytes); 308 size_t offset, size_t rowBytes, GrFence* fence);
309 309
310 /** 310 /**
311 * This is can be called before allocating a texture to be a dst for copySur face. This is only 311 * This is can be called before allocating a texture to be a dst for copySur face. This is only
312 * used for doing dst copies needed in blends, thus the src is always a GrRe nderTarget. It will 312 * used for doing dst copies needed in blends, thus the src is always a GrRe nderTarget. It will
313 * populate the origin, config, and flags fields of the desc such that copyS urface can 313 * populate the origin, config, and flags fields of the desc such that copyS urface can
314 * efficiently succeed. 314 * efficiently succeed.
315 */ 315 */
316 virtual bool initDescForDstCopy(const GrRenderTarget* src, GrSurfaceDesc* de sc) const = 0; 316 virtual bool initDescForDstCopy(const GrRenderTarget* src, GrSurfaceDesc* de sc) const = 0;
317 317
318 // After the client interacts directly with the 3D context state the GrGpu 318 // After the client interacts directly with the 3D context state the GrGpu
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 // directly to the Gpu object. 364 // directly to the Gpu object.
365 virtual GrGpuCommandBuffer* createCommandBuffer( 365 virtual GrGpuCommandBuffer* createCommandBuffer(
366 GrRenderTarget* target, 366 GrRenderTarget* target,
367 const GrGpuCommandBuffer::LoadAndStoreInfo& colorInfo, 367 const GrGpuCommandBuffer::LoadAndStoreInfo& colorInfo,
368 const GrGpuCommandBuffer::LoadAndStoreInfo& stencilInfo) = 0; 368 const GrGpuCommandBuffer::LoadAndStoreInfo& stencilInfo) = 0;
369 369
370 // Called by drawtarget when flushing. 370 // Called by drawtarget when flushing.
371 // Provides a hook for post-flush actions (e.g. PLS reset and Vulkan command buffer submits). 371 // Provides a hook for post-flush actions (e.g. PLS reset and Vulkan command buffer submits).
372 virtual void finishDrawTarget() {} 372 virtual void finishDrawTarget() {}
373 373
374 virtual GrFence SK_WARN_UNUSED_RESULT insertFence() const = 0;
375 virtual bool waitFence(GrFence, uint64_t timeout = 1000) const = 0;
376 virtual void deleteFence(GrFence) const = 0;
377
374 /////////////////////////////////////////////////////////////////////////// 378 ///////////////////////////////////////////////////////////////////////////
375 // Debugging and Stats 379 // Debugging and Stats
376 380
377 class Stats { 381 class Stats {
378 public: 382 public:
379 #if GR_GPU_STATS 383 #if GR_GPU_STATS
380 Stats() { this->reset(); } 384 Stats() { this->reset(); }
381 385
382 void reset() { 386 void reset() {
383 fRenderTargetBinds = 0; 387 fRenderTargetBinds = 0;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 SkSTArray<1, MultisampleSpecs, true> fMultisampleSpecs; 602 SkSTArray<1, MultisampleSpecs, true> fMultisampleSpecs;
599 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. 603 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu.
600 GrContext* fContext; 604 GrContext* fContext;
601 605
602 friend class GrPathRendering; 606 friend class GrPathRendering;
603 friend class gr_instanced::InstancedRendering; 607 friend class gr_instanced::InstancedRendering;
604 typedef SkRefCnt INHERITED; 608 typedef SkRefCnt INHERITED;
605 }; 609 };
606 610
607 #endif 611 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698